-
Notifications
You must be signed in to change notification settings - Fork 632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix] Always use latest ETH wallet contract #12038
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ use near_vm_runner::logic::errors::{AnyError, VMLogicError}; | |
use near_vm_runner::logic::types::ReceiptIndex; | ||
use near_vm_runner::logic::{External, StorageGetMode, ValuePtr}; | ||
use near_vm_runner::{Contract, ContractCode}; | ||
use near_wallet_contract::{code_hash_matches_wallet_contract, wallet_contract}; | ||
use near_wallet_contract::wallet_contract; | ||
use std::sync::Arc; | ||
|
||
pub struct RuntimeExt<'a> { | ||
|
@@ -379,11 +379,12 @@ impl<'a> Contract for RuntimeContractExt<'a> { | |
let code_hash = self.hash(); | ||
let version = self.current_protocol_version; | ||
let chain_id = self.chain_id; | ||
// We are removing the check to match code_hash_matches_wallet_contract | ||
// If the account type is EthImplicitAccount, we always load the latest (PV 71) wallet contract. | ||
if checked_feature!("stable", EthImplicitAccounts, version) | ||
&& account_id.get_account_type() == AccountType::EthImplicitAccount | ||
&& code_hash_matches_wallet_contract(chain_id, &code_hash, version) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. todo: Verify if it is fine to remove this check There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We actually cannot remove this check because not all accounts that look like eth-implicit have the wallet contract magic bytes (see details in this PR description). |
||
{ | ||
return Some(wallet_contract(&chain_id, version)); | ||
return Some(wallet_contract(&chain_id)); | ||
} | ||
let mode = match checked_feature!("stable", ChunkNodesCache, version) { | ||
true => Some(TrieCacheMode::CachingShard), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit. once you remove the code below, this comment will not refer to any check after merging.