Skip to content

Commit

Permalink
Release 8.61.0 (#895)
Browse files Browse the repository at this point in the history
* updated spec version 60 -> 61

* fixes to weights, tests and internal migration conditions
  • Loading branch information
zees-dev authored Oct 17, 2024
1 parent c762d5a commit 894bb36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("root"),
impl_name: create_runtime_str!("root"),
authoring_version: 1,
spec_version: 60,
spec_version: 61,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 11,
Expand Down
12 changes: 6 additions & 6 deletions runtime/src/migrations/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl OnRuntimeUpgrade for Upgrade {
log::info!(target: "Migration", "🛠️ EVM: creating EIP-2470 factory deployer and factory contract 🛠️");

// reading factory deployer
let mut weight = <Runtime as frame_system::Config>::DbWeight::get().reads(3);
let mut weight = <Runtime as frame_system::Config>::DbWeight::get().reads(1);

let eip2470_factory = H160::from_str(EIP2470_CONTRACT_ADDRESS).unwrap();
let factory_code_len =
Expand Down Expand Up @@ -159,10 +159,10 @@ pub mod v1 {
where
<Runtime as frame_system::Config>::AccountId: From<H160>,
{
let mut weight = <Runtime as frame_system::Config>::DbWeight::get().reads(6);
let mut weight = <Runtime as frame_system::Config>::DbWeight::get().reads(3);

// r: 3 + 3, w: 0
if !(EVM::is_account_empty(&deployer_eoa) && EVM::is_account_empty(&contract_address)) {
// r: 3, w: 0
if !EVM::is_account_empty(&contract_address) {
log::info!(target: "Migration", "No migration was done, however migration code needs to be removed.");
return weight;
}
Expand Down Expand Up @@ -233,11 +233,11 @@ pub mod v1 {
Upgrade::post_upgrade(pre_upgrade_state).expect("Post-upgrade should succeed");

// Validate future runtime upgrade fails
// 3 reads for factory deployer check only
// 1 read for factory check only
let new_weight = Upgrade::on_runtime_upgrade();
assert_eq!(
new_weight,
<Runtime as frame_system::Config>::DbWeight::get().reads(3),
<Runtime as frame_system::Config>::DbWeight::get().reads(1),
"Migration weight mismatch"
);
});
Expand Down

0 comments on commit 894bb36

Please sign in to comment.