Skip to content

Commit

Permalink
sc 0.51.0, codec 0.20.0, vm 0.9.0, sdk 0.5.0, scenario-format 0.22.3
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Jul 6, 2024
1 parent 76d706b commit d17a1ed
Show file tree
Hide file tree
Showing 278 changed files with 459 additions and 429 deletions.
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,36 @@ They are:
- `multiversx-chain-scenario-format`, in short `scenario-format`, scenario JSON serializer/deserializer, 1 crate.
- `multiversx-sdk`, in short `sdk`, allows communication with the chain(s), 1 crate.

## [sc 0.51.0, codec 0.20.0, vm 0.9.0, sdk 0.5.0, scenario-format 0.22.3] - 2024-07-06
- Major refactoring of `multiversx-sc-meta`
- Crate `multiversx-sc-meta` split in 2:
1. `multiversx-sc-meta` remains the standalone tool. For backwards compatibility, it can still be used in contract meta crates, but a warning will be issued.
2. `multiversx-sc-meta-lib` is the contract-only library to contract meta crates.
- The refactoring came with few code changes, but dependencies were disentangled and cleaned up.
- Account retrieval tool was merged into `sc-meta` standalone. Previously little known feature, it enables downloading the full state of an account and formatting it as a mandos set state step. Very useful for generating tests and investigating state.
- `multiversx-sdk` was also refactored, especially the gateway proxy.
- A new code report is available in the `.mxsc.json` build output. The report analyzes the wasm code after build and always offers the following information:
- `imports`: what VM hooks are used;
- `eiCheck`: if the used imports comply with the environment interface (EI, allowed VM hooks);
- `hasAllocator`: is it allocates on the heap;
- `hasPanic`: whether it produces Rust panics and formats error messages using the standard Rust formatter (a source of code bloat).
- `ManagedDecimal` and `ManagedDecimalSigned`:
- New types that encapulate a managed `BigUint` and `BigInt` respectively, but treat them as base 10 fixed point rational numbers.
- Two flavors are allowed: the number of decimals is known at compile time (e.g. EGLD always has 18 decimals), or only at runtime.
- Type `ConstDecimals` is able to resolve conversions at compile time, reducing code size and making encoding and decoding easier, since the number of decimals does not need to be encoded.
- Regular `usize` number of decimals is resolved at runtime.
- All basic arithmetic operations are implemented for these types, just like for the big integers.
- Implemented logarithms:
- Natural logarithm `ln` for `ManagedDecimal`, `BigFloat`, and `BigInt`.
- Base 2 logarithm `log2` for `ManagedDecimal`.
- Precision is about 5 decimals, largely irrespective of input.
- The operation is cheap, `ln` costs 44980 gas for managed decimals and 153772 for big floats, largely irrespective of input.
- Smart contract code on the front-end:
- Framework and contract code, together with the Rust VM as a backend, can now be compiled to WebAssembly for front-end, using `wasm-bindgen`.
- A few incompatible Rust VM features needed to be made optional for this to work.
- Reverted changes in `sc 0.50.6` (`diagnostic::on_unimplemented` & rustc 1.78 dependency).
- Bugfix: `sync_call_readonly` can now be used with proxies.


## [sc 0.50.6] - 2024-07-05
- Temporarily removed dependency to rustc 1.78, to ease transition from older versions. Will be re-enabled in 0.51.0.
Expand Down
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions contracts/benchmarks/large-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ publish = false
path = "src/large_storage.rs"

[dependencies.multiversx-sc]
version = "0.50.6"
version = "0.51.0"
path = "../../../framework/base"

[dev-dependencies.multiversx-sc-scenario]
version = "0.50.6"
version = "0.51.0"
path = "../../../framework/scenario"
2 changes: 1 addition & 1 deletion contracts/benchmarks/large-storage/meta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ publish = false
path = ".."

[dependencies.multiversx-sc-meta-lib]
version = "0.50.6"
version = "0.51.0"
path = "../../../../framework/meta-lib"
default-features = false
2 changes: 1 addition & 1 deletion contracts/benchmarks/large-storage/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ panic = "abort"
path = ".."

[dependencies.multiversx-sc-wasm-adapter]
version = "0.50.6"
version = "0.51.0"
path = "../../../../framework/wasm-adapter"

[workspace]
Expand Down
4 changes: 2 additions & 2 deletions contracts/benchmarks/mappers/benchmark-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ publish = false
path = "src/lib.rs"

[dependencies.multiversx-sc]
version = "0.50.6"
version = "0.51.0"
path = "../../../../framework/base"

[dev-dependencies.multiversx-sc-scenario]
version = "0.50.6"
version = "0.51.0"
path = "../../../../framework/scenario"
4 changes: 2 additions & 2 deletions contracts/benchmarks/mappers/linked-list-repeat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ path = "../benchmark-common"


[dependencies.multiversx-sc]
version = "0.50.6"
version = "0.51.0"
path = "../../../../framework/base"

[dev-dependencies.multiversx-sc-scenario]
version = "0.50.6"
version = "0.51.0"
path = "../../../../framework/scenario"
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ publish = false
path = ".."

[dependencies.multiversx-sc-meta-lib]
version = "0.50.6"
version = "0.51.0"
path = "../../../../../framework/meta-lib"
default-features = false
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ panic = "abort"
path = ".."

[dependencies.multiversx-sc-wasm-adapter]
version = "0.50.6"
version = "0.51.0"
path = "../../../../../framework/wasm-adapter"

[workspace]
Expand Down
4 changes: 2 additions & 2 deletions contracts/benchmarks/mappers/map-repeat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ path = "../benchmark-common"


[dependencies.multiversx-sc]
version = "0.50.6"
version = "0.51.0"
path = "../../../../framework/base"

[dev-dependencies.multiversx-sc-scenario]
version = "0.50.6"
version = "0.51.0"
path = "../../../../framework/scenario"
2 changes: 1 addition & 1 deletion contracts/benchmarks/mappers/map-repeat/meta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ publish = false
path = ".."

[dependencies.multiversx-sc-meta-lib]
version = "0.50.6"
version = "0.51.0"
path = "../../../../../framework/meta-lib"
default-features = false
2 changes: 1 addition & 1 deletion contracts/benchmarks/mappers/map-repeat/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ panic = "abort"
path = ".."

[dependencies.multiversx-sc-wasm-adapter]
version = "0.50.6"
version = "0.51.0"
path = "../../../../../framework/wasm-adapter"

[workspace]
Expand Down
4 changes: 2 additions & 2 deletions contracts/benchmarks/mappers/queue-repeat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ path = "../benchmark-common"


[dependencies.multiversx-sc]
version = "0.50.6"
version = "0.51.0"
path = "../../../../framework/base"

[dev-dependencies.multiversx-sc-scenario]
version = "0.50.6"
version = "0.51.0"
path = "../../../../framework/scenario"
2 changes: 1 addition & 1 deletion contracts/benchmarks/mappers/queue-repeat/meta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ publish = false
path = ".."

[dependencies.multiversx-sc-meta-lib]
version = "0.50.6"
version = "0.51.0"
path = "../../../../../framework/meta-lib"
default-features = false
2 changes: 1 addition & 1 deletion contracts/benchmarks/mappers/queue-repeat/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ panic = "abort"
path = ".."

[dependencies.multiversx-sc-wasm-adapter]
version = "0.50.6"
version = "0.51.0"
path = "../../../../../framework/wasm-adapter"

[workspace]
Expand Down
4 changes: 2 additions & 2 deletions contracts/benchmarks/mappers/set-repeat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ path = "../benchmark-common"


[dependencies.multiversx-sc]
version = "0.50.6"
version = "0.51.0"
path = "../../../../framework/base"

[dev-dependencies.multiversx-sc-scenario]
version = "0.50.6"
version = "0.51.0"
path = "../../../../framework/scenario"
2 changes: 1 addition & 1 deletion contracts/benchmarks/mappers/set-repeat/meta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ publish = false
path = ".."

[dependencies.multiversx-sc-meta-lib]
version = "0.50.6"
version = "0.51.0"
path = "../../../../../framework/meta-lib"
default-features = false
2 changes: 1 addition & 1 deletion contracts/benchmarks/mappers/set-repeat/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ panic = "abort"
path = ".."

[dependencies.multiversx-sc-wasm-adapter]
version = "0.50.6"
version = "0.51.0"
path = "../../../../../framework/wasm-adapter"

[workspace]
Expand Down
4 changes: 2 additions & 2 deletions contracts/benchmarks/mappers/single-value-repeat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ path = "../benchmark-common"


[dependencies.multiversx-sc]
version = "0.50.6"
version = "0.51.0"
path = "../../../../framework/base"

[dev-dependencies.multiversx-sc-scenario]
version = "0.50.6"
version = "0.51.0"
path = "../../../../framework/scenario"
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ publish = false
path = ".."

[dependencies.multiversx-sc-meta-lib]
version = "0.50.6"
version = "0.51.0"
path = "../../../../../framework/meta-lib"
default-features = false
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ panic = "abort"
path = ".."

[dependencies.multiversx-sc-wasm-adapter]
version = "0.50.6"
version = "0.51.0"
path = "../../../../../framework/wasm-adapter"

[workspace]
Expand Down
4 changes: 2 additions & 2 deletions contracts/benchmarks/mappers/vec-repeat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ path = "../benchmark-common"


[dependencies.multiversx-sc]
version = "0.50.6"
version = "0.51.0"
path = "../../../../framework/base"

[dev-dependencies.multiversx-sc-scenario]
version = "0.50.6"
version = "0.51.0"
path = "../../../../framework/scenario"
2 changes: 1 addition & 1 deletion contracts/benchmarks/mappers/vec-repeat/meta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ publish = false
path = ".."

[dependencies.multiversx-sc-meta-lib]
version = "0.50.6"
version = "0.51.0"
path = "../../../../../framework/meta-lib"
default-features = false
2 changes: 1 addition & 1 deletion contracts/benchmarks/mappers/vec-repeat/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ panic = "abort"
path = ".."

[dependencies.multiversx-sc-wasm-adapter]
version = "0.50.6"
version = "0.51.0"
path = "../../../../../framework/wasm-adapter"

[workspace]
Expand Down
Loading

0 comments on commit d17a1ed

Please sign in to comment.