Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ test-e2e:
cargo test --package test-service -- --include-ignored --skip test_full_node_catching_up --skip simple_balances_test

.PHONY: test-ts
test-ts:
cargo build --release --features with-mandala-runtime
test-ts: build-mandala-internal-release
cd ts-tests && yarn && yarn run build && ACALA_BUILD=release yarn run test

.PHONY: test-benchmarking
Expand Down
2 changes: 1 addition & 1 deletion evm-bench
6 changes: 3 additions & 3 deletions modules/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,19 @@ pub type NegativeImbalanceOf<T> =
pub const RESERVE_ID_STORAGE_DEPOSIT: ReserveIdentifier = ReserveIdentifier::EvmStorageDeposit;
pub const RESERVE_ID_DEVELOPER_DEPOSIT: ReserveIdentifier = ReserveIdentifier::EvmDeveloperDeposit;

// Initially based on Istanbul hard fork configuration.
// Initially based on London hard fork configuration.
static ACALA_CONFIG: EvmConfig = EvmConfig {
refund_sstore_clears: 0, // no gas refund
sstore_gas_metering: false, // no gas refund
sstore_revert_under_stipend: false, // ignored
create_contract_limit: Some(MaxCodeSize::get() as usize),
..module_evm_utility::evm::Config::istanbul()
..module_evm_utility::evm::Config::london()
};

/// Create an empty contract `contract Empty { }`.
pub const BASE_CREATE_GAS: u64 = 67_066;
/// Call function that just set a storage `function store(uint256 num) public { number = num; }`.
pub const BASE_CALL_GAS: u64 = 41_602;
pub const BASE_CALL_GAS: u64 = 43_702;

/// Helper method to calculate `create` weight.
fn create_weight<T: Config>(gas: u64) -> Weight {
Expand Down
10 changes: 5 additions & 5 deletions modules/evm/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ fn publish_factory() {
)
.unwrap();
assert_eq!(result.exit_reason, ExitReason::Succeed(ExitSucceed::Returned));
assert_eq!(result.used_gas.as_u64(), 156_479u64);
assert_eq!(result.used_gas.as_u64(), 155_879u64);
assert_eq!(result.used_storage, 461);
assert_eq!(
balance(alice()),
Expand Down Expand Up @@ -1698,7 +1698,7 @@ fn evm_execute_mode_should_work() {
CallInfo {
exit_reason: ExitReason::Succeed(ExitSucceed::Stopped),
value: vec![],
used_gas: U256::from(139_845),
used_gas: U256::from(142_445),
used_storage: 290,
logs: vec![]
}
Expand All @@ -1721,7 +1721,7 @@ fn evm_execute_mode_should_work() {
CallInfo {
exit_reason: ExitReason::Succeed(ExitSucceed::Stopped),
value: vec![],
used_gas: U256::from(256_402),
used_gas: U256::from(259_561),
used_storage: 580,
logs: vec![]
}
Expand Down Expand Up @@ -1761,7 +1761,7 @@ fn evm_execute_mode_should_work() {
CallInfo {
exit_reason: ExitReason::Succeed(ExitSucceed::Stopped),
value: vec![],
used_gas: U256::from(107_869),
used_gas: U256::from(110_469),
used_storage: 290,
logs: vec![]
}
Expand Down Expand Up @@ -1789,7 +1789,7 @@ fn evm_execute_mode_should_work() {
CallInfo {
exit_reason: ExitReason::Succeed(ExitSucceed::Stopped),
value: vec![],
used_gas: U256::from(92_869),
used_gas: U256::from(93_369),
used_storage: 290,
logs: vec![]
}
Expand Down
2 changes: 1 addition & 1 deletion predeploy-contracts
Submodule predeploy-contracts updated 0 files
2 changes: 1 addition & 1 deletion runtime/common/src/precompile/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ fn schedule_precompile_should_work() {
run_to_block(5);
#[cfg(not(feature = "with-ethereum-compatibility"))]
{
assert_eq!(Balances::free_balance(from_account.clone()), 999999972553);
assert_eq!(Balances::free_balance(from_account.clone()), 999999973153);
assert_eq!(Balances::reserved_balance(from_account), 0);
assert_eq!(Balances::free_balance(to_account), 1000000001000);
}
Expand Down
4 changes: 2 additions & 2 deletions runtime/mandala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,7 @@ impl<I: From<Balance>> frame_support::traits::Get<I> for TxFeePerGas {
}

#[cfg(feature = "with-ethereum-compatibility")]
static ISTANBUL_CONFIG: module_evm_utility::evm::Config = module_evm_utility::evm::Config::istanbul();
static LONDON_CONFIG: module_evm_utility::evm::Config = module_evm_utility::evm::Config::london();

impl module_evm::Config for Runtime {
type AddressMapping = EvmAddressMapping<Runtime>;
Expand Down Expand Up @@ -1561,7 +1561,7 @@ impl module_evm::Config for Runtime {

#[cfg(feature = "with-ethereum-compatibility")]
fn config() -> &'static module_evm_utility::evm::Config {
&ISTANBUL_CONFIG
&LONDON_CONFIG
}
}

Expand Down
2 changes: 1 addition & 1 deletion ts-tests/tests/test-precompiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describeWithAcala("Acala RPC (Precompile)", (context) => {
from: await alice.getAddress(),
confirmations: 0,
nonce: 1,
gasLimit: BigNumber.from("30788"),
gasLimit: BigNumber.from("28572"),
gasPrice: BigNumber.from("1"),
//data: "",
value: BigNumber.from(0),
Expand Down