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

feat(anvil): remove old ethers-dependent anvil core types #6842

Merged
merged 11 commits into from
Jan 19, 2024

Conversation

Evalir
Copy link
Member

@Evalir Evalir commented Jan 18, 2024

Motivation

removes ethers usage in all of anvil. Only remaining usage is:

  • tests (removal in progress)
  • block subscriptions (needs further work on alloy, we will most likely roll our own version of this)

test failures will be fixed in another PR on 6808.

Goes into #6808.

Solution

Copy link
Member

@gakonst gakonst left a comment

Choose a reason for hiding this comment

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

getting there!

@@ -2540,12 +2531,13 @@ pub fn prove_storage(
.unwrap();

let item: U256 = {
let decode_value = |bytes: &[u8]| rlp::decode(bytes).expect("decoding db value failed");
let decode_value = |mut bytes: &[u8]| {
<U256 as alloy_rlp::Decodable>::decode(&mut bytes).expect("decoding db value failed")
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't U256::decode work?

crates/anvil/src/eth/error.rs Outdated Show resolved Hide resolved
@@ -1,225 +0,0 @@
use crate::eth::error::BlockchainError;
Copy link
Member

Choose a reason for hiding this comment

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

@mattsse IIRC this was due to lack of object safety on signer?

@Evalir Evalir marked this pull request as ready for review January 18, 2024 21:01
@Evalir Evalir requested a review from mattsse as a code owner January 18, 2024 21:01
Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

pog

crates/anvil/src/eth/backend/mem/mod.rs Outdated Show resolved Hide resolved
crates/anvil/src/eth/backend/mem/state.rs Outdated Show resolved Hide resolved
crates/anvil/tests/it/proof/mod.rs Outdated Show resolved Hide resolved
@Evalir Evalir requested a review from onbjerg January 18, 2024 21:20
Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

lgtm, tests fixed in follow up and we're merging into a feature branch so should be good to merge

@@ -33,6 +33,35 @@ pub mod sequence {
}
}

pub mod numeric {
Copy link
Member

Choose a reason for hiding this comment

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

Should this be an alloy util? @DaniPopes

crates/anvil/src/config.rs Outdated Show resolved Hide resolved
@Evalir Evalir changed the title feat(anvil): remove ethers & old ethers-dependent anvil core types feat(anvil): remove old ethers-dependent anvil core types Jan 19, 2024
@Evalir Evalir merged commit b575796 into evalir/migrate-base-anvil Jan 19, 2024
11 of 19 checks passed
@Evalir Evalir deleted the evalir/remove-old-core-type branch January 19, 2024 16:36
Evalir added a commit that referenced this pull request Jan 25, 2024
* here we go again

* wip: storage

* chore: migrate executor, fmt

* wip

* chore: roughly only signers left

* feat: migrate proof, bar trie stuff

* chore: onto tests

* chore: passing most tests

* chore: fix impersonate

* chore: op tests passing

* txenvelope

* chore: some fixes, typed data

* feat(`anvil`): remove old ethers-dependent anvil core types (#6842)

* feat: remove most ethers and old anvil core types

* chore: replace handles for providers constructed on actual tests

* finish moving test providers

* chore: switch to decode_revert

* chore: replace with maybe_decode_revert

* u256::decode

* chore: move all of anvil but tests and block subscriptions off ethers

* re-enable opt

* solve nits

* chore: remove more println

* chore: rename to gen

* chore: update alloy, cleanup

* chore: fix tests

* chore: rename to sign

* chore: fmt

* chore: cleanup

* docs

* chore: more cleanup

* clippy/fmt

* chore: remove ethers from anvil-core, rm fastrlp

* chore: remove fastrlp from exceptions in deny.toml

* chore: rename and cleanup

* directly use type to decode

* address review comments

* feat: onbjerg nits

* chore: fix deny check

* bump alloy

* chore: add to_ethers ext trait for wallets

* chore: update deps, revert changed typed-data tests, set chain id as none when signing typed data

---------

Co-authored-by: Oliver Nordbjerg <hi@notbjerg.me>
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