Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

shreyan-gupta
Copy link
Contributor

@shreyan-gupta shreyan-gupta commented Sep 4, 2024

There was originally a bug fix to the ETH contract code

This PR removes the check for protocol version >= 71 and < 71 and always tries to load the latest wallet contract code for ETH implicit accounts

@shreyan-gupta shreyan-gupta requested a review from a team as a code owner September 4, 2024 06:44
@shreyan-gupta shreyan-gupta requested review from wacban and removed request for a team September 4, 2024 06:44
if checked_feature!("stable", EthImplicitAccounts, version)
&& account_id.get_account_type() == AccountType::EthImplicitAccount
&& code_hash_matches_wallet_contract(chain_id, &code_hash, version)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: Verify if it is fine to remove this check

Copy link
Contributor

Choose a reason for hiding this comment

The 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).

@@ -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
Copy link
Contributor

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.

@wacban
Copy link
Contributor

wacban commented Sep 4, 2024

Can you provide more context?

  1. What bug exactly is this PR fixing?
  2. Why are you requesting to merge to 2.2 instead of master?
  3. Wouldn't this break replayability?

if checked_feature!("stable", EthImplicitAccounts, version)
&& account_id.get_account_type() == AccountType::EthImplicitAccount
&& code_hash_matches_wallet_contract(chain_id, &code_hash, version)
Copy link
Contributor

Choose a reason for hiding this comment

The 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants