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

refactor: forbid call eth_getStorageAt to system contract accounts #1619

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

KaoImin
Copy link
Contributor

@KaoImin KaoImin commented Dec 4, 2023

What this PR does / why we need it?

This PR forbid call eth_getStorageAt to system contract accounts.

What is the impact of this PR?

No Breaking Change

PR relation:

CI Settings

CI Usage

Tip: Check the CI you want to run below, and then comment /run-ci.

CI Switch

  • Web3 Compatible Tests
  • OpenZeppelin tests
  • v3 Core Tests

CI Description

CI Name Description
Web3 Compatible Test Test the Web3 compatibility of Axon
v3 Core Test Run the compatibility tests provided by Uniswap V3
OpenZeppelin tests Run the compatibility tests provided by OpenZeppelin, including OCT 1-5 | 6-10 | 11 | 12-15 | 16-19

@KaoImin KaoImin requested a review from a team as a code owner December 4, 2023 07:39
@KaoImin KaoImin changed the title refactor: forbid get storage of system contract account refactor: forbid call eth_getStorageAt to system contract accounts Dec 4, 2023
@KaoImin KaoImin requested review from Flouse and driftluo and removed request for wenyuanhust December 4, 2023 07:49
Copy link
Contributor

@Flouse Flouse left a comment

Choose a reason for hiding this comment

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

#[metrics_rpc("eth_getProof")]
async fn get_proof(
&self,
address: H160,
storage_position: Vec<U256>,
number: BlockId,
) -> RpcResult<EthAccountProof> {
if is_system_contract_address_format(&address) {
return Err(RpcError::CallSystemContract.into());
}

eth_getProof has implemented the same check.

@KaoImin KaoImin enabled auto-merge December 4, 2023 07:56
@KaoImin KaoImin added this pull request to the merge queue Dec 4, 2023
Merged via the queue into main with commit 5d59656 Dec 4, 2023
28 of 29 checks passed
@KaoImin KaoImin deleted the fix-get-storage-at branch December 5, 2023 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should we apply the same logic to all reserved system contracts addresses?
3 participants