Skip to content

Commit

Permalink
Merge #4008
Browse files Browse the repository at this point in the history
4008: Updates toolchain to a more recent 2023-03-25 r=mpapierski a=mpapierski

This bumps a toolchain for contract API to more recent 2023-03-25. This is not the most recent, as the current nightly appears to produce non-mvp WebAssembly opcodes which are not supported on our platform. Apparently this version update also decerases gas cost on average in our tests.

See also upstream compiler issue here: rust-lang/rust#109807

Co-authored-by: Michał Papierski <michal@casperlabs.io>
  • Loading branch information
casperlabs-bors-ng[bot] and Michał Papierski committed Jun 2, 2023
2 parents 0afe337 + 2666794 commit 3eff557
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions execution_engine_testing/tests/src/test/explorer/faucet.rs
Expand Up @@ -841,13 +841,13 @@ fn faucet_costs() {
// This test will fail if execution costs vary. The expected costs should not be updated
// without understanding why the cost has changed. If the costs do change, it should be
// reflected in the "Costs by Entry Point" section of the faucet crate's README.md.
const EXPECTED_FAUCET_INSTALL_COST: u64 = 71_691_403_720;
const EXPECTED_FAUCET_SET_VARIABLES_COST: u64 = 623_279_550;
const EXPECTED_FAUCET_CALL_BY_INSTALLER_COST: u64 = 3_101_326_690;
const EXPECTED_FAUCET_CALL_BY_USER_COST: u64 = 3_350_546_610;
const EXPECTED_FAUCET_INSTALL_COST: u64 = 75_226_865_930;
const EXPECTED_FAUCET_SET_VARIABLES_COST: u64 = 579_464_060;
const EXPECTED_FAUCET_CALL_BY_INSTALLER_COST: u64 = 3_040_141_320;
const EXPECTED_FAUCET_CALL_BY_USER_COST: u64 = 3_242_199_690;

let installer_account = AccountHash::new([1u8; 32]);
let user_account = AccountHash::new([2u8; 32]);
let user_account: AccountHash = AccountHash::new([2u8; 32]);

let mut builder = InMemoryWasmTestBuilder::default();
builder.run_genesis(&PRODUCTION_RUN_GENESIS_REQUEST);
Expand Down
Expand Up @@ -22,7 +22,7 @@ const CONTRACT_TRANSFER_TO_ACCOUNT_U512: &str = "transfer_to_account_u512.wasm";
// This value is not systemic, as code is added the size of WASM will increase,
// you can change this value to reflect the increase in WASM size.
const HOST_FUNCTION_METRICS_STANDARD_SIZE: usize = 97_569;
const HOST_FUNCTION_METRICS_STANDARD_GAS_COST: u64 = 375_298_466_170;
const HOST_FUNCTION_METRICS_STANDARD_GAS_COST: u64 = 347_080_271_020;

/// Acceptable size regression/improvement in percentage.
const SIZE_MARGIN: usize = 5;
Expand Down
8 changes: 4 additions & 4 deletions smart_contracts/contracts/explorer/faucet/README.md
Expand Up @@ -35,7 +35,7 @@ If you try to invoke the contract before these variables are set, then you'll ge

| feature | cost |
|---------|------------------|
| faucet install | `71_691_403_720` |
| faucet set variables | `623_279_550` |
| faucet call by installer | `3_101_326_690` |
| faucet call by user | `3_350_546_610` |
| faucet install | `75_226_865_930` |
| faucet set variables | `579_464_060` |
| faucet call by installer | `3_040_141_320` |
| faucet call by user | `3_242_199_690` |
2 changes: 1 addition & 1 deletion smart_contracts/rust-toolchain
@@ -1 +1 @@
nightly-2022-08-03
nightly-2023-03-25

0 comments on commit 3eff557

Please sign in to comment.