Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
eed1aa5
working state injector prototype
alindima Aug 29, 2025
2da8975
remove superfluous code
alindima Aug 29, 2025
40d640a
second approach
alindima Sep 1, 2025
d4f7729
final approach
alindima Sep 2, 2025
cdfb8c5
remove accidental flamegraph
alindima Sep 2, 2025
f8e3b83
remove accidental file
alindima Sep 2, 2025
753e156
remove commented code
alindima Sep 2, 2025
559a923
more work
alindima Sep 3, 2025
9c0436c
Merge remote-tracking branch 'origin/master' into alindima/state-inje…
alindima Sep 5, 2025
7f74f3d
WIP
alindima Sep 5, 2025
b6e143b
WIP 2
alindima Sep 8, 2025
ae11483
Merge remote-tracking branch 'origin/master' into alindima/state-inje…
alindima Sep 8, 2025
d22a198
some cleanups
alindima Sep 8, 2025
82bd1e0
all methods implemented
alindima Sep 9, 2025
997548e
Merge remote-tracking branch 'origin/master' into alindima/state-inje…
alindima Sep 17, 2025
af650e5
Merge remote-tracking branch 'origin/master' into alindima/state-inje…
alindima Sep 18, 2025
5904eed
Merge remote-tracking branch 'origin/master' into alindima/state-inje…
alindima Sep 23, 2025
64ba863
revive rpc prototype
alindima Sep 10, 2025
2966780
WIP
alindima Sep 24, 2025
2edda24
Merge remote-tracking branch 'origin/master' into alindima/state-inje…
alindima Sep 25, 2025
af7a6bb
Merge remote-tracking branch 'origin/master' into alindima/state-inje…
alindima Sep 30, 2025
80560ab
some fixes
alindima Sep 30, 2025
3bbab5f
remove outdated file
alindima Sep 30, 2025
b0da9f0
random fixups
alindima Sep 30, 2025
585aca5
fix infinite loop
alindima Sep 30, 2025
fc98d82
fix: use opaque block
alindima Sep 30, 2025
a866dcc
cosmetics
alindima Sep 30, 2025
25f4a8e
avoid using thread::sleep
alindima Sep 30, 2025
093e012
fix balance injection
alindima Sep 30, 2025
36ad631
Merge remote-tracking branch 'origin/master' into alindima/state-inje…
alindima Oct 6, 2025
1aea87e
review feedback
alindima Oct 7, 2025
14288a3
some more set_nonce testing
alindima Oct 7, 2025
886f41a
add setBalance test
alindima Oct 7, 2025
9d97f18
Merge remote-tracking branch 'origin/master' into alindima/state-inje…
alindima Oct 7, 2025
fb243da
clippy
alindima Oct 8, 2025
3b615ac
Merge remote-tracking branch 'origin/master' into alindima/state-inje…
alindima Oct 8, 2025
d4fc234
fix merge damage
alindima Oct 8, 2025
6cf6d61
allow unused set timestamp for the time being
alindima Oct 8, 2025
4d69f06
don't enable tracing in tests by default
alindima Oct 8, 2025
be246cf
fix some more merge damage
alindima Oct 8, 2025
7070f6d
clippy
alindima Oct 8, 2025
06462cb
fix typos
alindima Oct 8, 2025
65c436e
fmt
alindima Oct 8, 2025
f6e59ce
silence some mining tests
alindima Oct 8, 2025
1f48d20
WIP
alindima Oct 9, 2025
6d7a3bd
Merge remote-tracking branch 'origin/master' into alindima/state-inje…
alindima Oct 9, 2025
99a2c99
add another test
alindima Oct 9, 2025
bdcec6d
clippy
alindima Oct 10, 2025
393c111
Merge remote-tracking branch 'origin/master' into alindima/state-inje…
alindima Oct 10, 2025
f65218b
fix setCode for new account and add more tests
alindima Oct 10, 2025
7b034f7
fix setStorageAt
alindima Oct 10, 2025
a3e485d
add setStorageAt test
alindima Oct 10, 2025
a957cd0
clippy
alindima Oct 10, 2025
070cecf
feedback
alindima Oct 15, 2025
f314bc7
Merge remote-tracking branch 'origin/master' into alindima/state-inje…
alindima Oct 15, 2025
cf88467
fix merge damage
alindima Oct 15, 2025
5cbdffa
some more feedback
alindima Oct 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions crates/anvil-polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ tempfile.workspace = true
itertools.workspace = true
rand_08.workspace = true
eyre.workspace = true
lru = "0.16.0"

# cli
clap = { version = "4", features = [
Expand All @@ -146,6 +147,7 @@ alloy-provider = { workspace = true, features = ["txpool-api"] }
alloy-pubsub.workspace = true
foundry-test-utils.workspace = true
tokio = { workspace = true, features = ["full"] }
assert_matches = "1.5.0"
rstest = "0.26.1"

op-alloy-rpc-types.workspace = true
Expand Down
23 changes: 15 additions & 8 deletions crates/anvil-polkadot/src/api_server/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use crate::substrate_node::mining_engine::MiningError;
use crate::substrate_node::{mining_engine::MiningError, service::BackendError};
use anvil_rpc::{error::RpcError, response::ResponseResult};
use polkadot_sdk::pallet_revive_eth_rpc::{EthRpcError, client::ClientError};
use polkadot_sdk::{
pallet_revive_eth_rpc::{EthRpcError, client::ClientError},
sp_api,
};
use serde::Serialize;

#[derive(Debug, thiserror::Error)]
Expand All @@ -13,9 +16,18 @@ pub enum Error {
InvalidParams(String),
#[error("Revive call failed: {0}")]
ReviveRpc(#[from] EthRpcError),
#[error(transparent)]
Backend(#[from] BackendError),
#[error("Nonce overflowing the substrate nonce type")]
NonceOverflow,
#[error(transparent)]
RuntimeApi(#[from] sp_api::ApiError),
#[error("Error encountered while creating a BalanceWithDust from a U256 balance")]

Choose a reason for hiding this comment

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

nit: I would not specify the internal types in the error message.

BalanceConversion,
#[error("Internal error: {0}")]
InternalError(String),
}

impl From<subxt::Error> for Error {
fn from(err: subxt::Error) -> Self {
Self::ReviveRpc(EthRpcError::ClientError(err.into()))
Expand Down Expand Up @@ -71,12 +83,7 @@ impl<T: Serialize> ToRpcResponseResult for Result<T> {
Error::InvalidParams(error_message) => {
RpcError::invalid_params(error_message).into()
}
Error::ReviveRpc(client_error) => {
RpcError::internal_error_with(format!("{client_error}")).into()
}
Error::InternalError(error_message) => {
RpcError::internal_error_with(error_message).into()
}
err => RpcError::internal_error_with(format!("{err}")).into(),
},
}
}
Expand Down
Loading
Loading