Skip to content

Commit

Permalink
feat: include transaction propagation feature (kkrt-labs#1375)
Browse files Browse the repository at this point in the history
* include alloy provider

* feat: propagation

* fix: remove alloy

* fix: remove alloy

* fix: import and cargo.lock

* feat: test test_send_raw_transaction_rpc_forwarding

* fix: import

* fix: refactoring

* fix: returned error in send_raw_transaction

* fix: cargo error

* fix tests + reformatting

Signed-off-by: Gregory Edison <gregory.edison1993@gmail.com>

* fix rebasing

Signed-off-by: Gregory Edison <gregory.edison1993@gmail.com>

* fix some compilation error when no feature is active

Signed-off-by: Gregory Edison <gregory.edison1993@gmail.com>

* run test with all features

Signed-off-by: Gregory Edison <gregory.edison1993@gmail.com>

* run test with testing and forwarding feature

Signed-off-by: Gregory Edison <gregory.edison1993@gmail.com>

* add mockito to testing feature

Signed-off-by: Gregory Edison <gregory.edison1993@gmail.com>

---------

Signed-off-by: Gregory Edison <gregory.edison1993@gmail.com>
Co-authored-by: Eugenio Paluello <eugypalu@gmail.com>
  • Loading branch information
greged93 and eugypalu authored Oct 29, 2024
1 parent ea31b60 commit 6714e35
Show file tree
Hide file tree
Showing 6 changed files with 258 additions and 42 deletions.
151 changes: 141 additions & 10 deletions Cargo.lock

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

66 changes: 37 additions & 29 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,25 @@ starknet = { version = "0.12", default-features = false }
num-traits = { version = "0.2", default-features = false }

# Ethereum dependencies
alloy-rlp = { version = "0.3.8", default-features = false }
alloy-sol-types = { version = "0.8.4", default-features = false }
alloy-consensus = { version = "0.4.2", default-features = false, optional = true }
alloy-contract = { version = "0.3.6", default-features = false }
alloy-provider = { version = "0.4.2", default-features = false, optional = true }
alloy-rlp = { version = "0.3.8", default-features = false }
alloy-rpc-types = { version = "0.4.2", features = [
"eth",
"arbitrary",
], default-features = false }
alloy-consensus = { version = "0.4.2", default-features = false, optional = true }
alloy-rpc-types-txpool = { version = "0.4.2", default-features = false }
alloy-rpc-types-trace = { version = "0.4.2", default-features = false }
alloy-sol-types = { version = "0.8.4", default-features = false }
jsonrpsee = { version = "0.24", features = ["macros", "server"] }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.1.0", default-features = false, features = [
"std",
] }
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.1.0", default-features = false, features = [
"std",
] }
reth-execution-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.1.0", default-features = false }
reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.1.0", default-features = false }
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.1.0", default-features = false, features = [
"alloy-compat",
Expand All @@ -86,12 +88,11 @@ reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.1
reth-revm = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.1.0", default-features = false, features = [
"std",
] }
reth-rpc = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.1.0", default-features = false }
reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.1.0", default-features = false }
reth-rpc-types-compat = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.1.0", default-features = false }
reth-testing-utils = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.1.0", default-features = false, optional = true }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.1.0", default-features = false }
reth-rpc-types-compat = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.1.0", default-features = false }
reth-execution-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.1.0", default-features = false }
reth-rpc = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.1.0", default-features = false }
revm-inspectors = "0.8.1"

# Error
Expand Down Expand Up @@ -148,17 +149,36 @@ hyper-util = { version = "0.1", default-features = false, features = [
http-body-util = { version = "0.1", default-features = false }
pin-project-lite = { version = "0.2", default-features = false }

# Testing crates
#### Testing crates ####
# Ethereum
foundry-config = { git = "https://github.com/foundry-rs/foundry", branch = "master", optional = true }
revm-interpreter = { version = "10.0", default-features = false, optional = true }
revm-primitives = { version = "10.0", default-features = false, optional = true }

# Alloy
alloy-dyn-abi = { version = "0.8.4", default-features = false }
alloy-eips = { version = "0.4.2", default-features = false }
alloy-json-abi = { version = "0.8.4", default-features = false, optional = true }
alloy-primitives = { version = "0.8.4", default-features = false }
alloy-signer-local = { version = "0.4.2", default-features = false, optional = true }
alloy-signer = { version = "0.4.2", default-features = false, optional = true }
alloy-serde = { version = "0.4.2", default-features = false }
alloy-eips = { version = "0.4.2", default-features = false }

# Starknet
dojo-test-utils = { git = 'https://github.com/dojoengine/dojo', tag = "v1.0.0-alpha.15", default-features = false, optional = true }
katana-node = { git = 'https://github.com/dojoengine/dojo', tag = "v1.0.0-alpha.15", default-features = false, optional = true }
katana-primitives = { git = 'https://github.com/dojoengine/dojo', tag = "v1.0.0-alpha.15", default-features = false, features = [
"serde",
], optional = true }
starknet_api = { version = "0.13.0-rc.0", optional = true }
starknet-crypto = { version = "0.7", optional = true }

# Misc
anyhow = { version = "1", default-features = false, optional = true }
arbitrary = { version = "1", features = ["derive"], optional = true }
foundry-config = { git = "https://github.com/foundry-rs/foundry", branch = "master", optional = true }
clap = { version = "4.5.17", optional = true }
mockall = { version = "0.13.0", default-features = false, optional = true }
mockito = { version = "1.5.0", default-features = false, optional = true }
rand = { version = "0.8", default-features = false }
rayon = { version = "1", default-features = false, optional = true }
rstest = { version = "0.21", default-features = false, optional = true }
Expand All @@ -172,20 +192,6 @@ tokio-util = { version = "0.7", features = [
tokio-stream = { version = "0.1", default-features = false, optional = true }
walkdir = { version = "2.5", default-features = false, optional = true }

dojo-test-utils = { git = 'https://github.com/dojoengine/dojo', tag = "v1.0.0-alpha.15", default-features = false, optional = true }
katana-node = { git = 'https://github.com/dojoengine/dojo', tag = "v1.0.0-alpha.15", default-features = false, optional = true }
katana-primitives = { git = 'https://github.com/dojoengine/dojo', tag = "v1.0.0-alpha.15", default-features = false, features = [
"serde",
], optional = true }
mockall = { version = "0.13.0", default-features = false, optional = true }
clap = { version = "4.5.17", optional = true }


starknet_api = { version = "0.13.0-rc.0", optional = true }
revm-interpreter = { version = "10.0", default-features = false, optional = true }
revm-primitives = { version = "10.0", default-features = false, optional = true }
starknet-crypto = { version = "0.7", optional = true }

[dev-dependencies]
hex = { version = "0.4", default-features = false }
proptest = { version = "1.5", default-features = false }
Expand All @@ -195,34 +201,36 @@ tempfile = "3.8"

[features]
testing = [
"alloy-consensus",
"alloy-json-abi",
"alloy-signer-local",
"alloy-signer",
"alloy-consensus",
"anyhow",
"dep:arbitrary",
"dojo-test-utils",
"katana-node",
"foundry-config",
"katana-node",
"katana-primitives",
"mockall",
"mockito",
"rayon",
"reth-testing-utils",
"revm-interpreter",
"revm-primitives",
"rstest",
"serde_with",
"starknet_api",
"starknet-crypto",
"strum",
"strum_macros",
"testcontainers",
"tokio-stream",
"tokio-util",
"walkdir",
"starknet_api",
"revm-interpreter",
"revm-primitives",
"starknet-crypto",
]
binaries = ["clap"]
hive = []
forwarding = ["alloy-provider/reqwest"]
arbitrary = ["dep:arbitrary"]

[[bin]]
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ test: katana-genesis load-env
cargo test --all --features testing

test-ci: load-env
cargo nextest run --all --features testing --profile ci
cargo nextest run --all --features "testing,forwarding" --profile ci

# Example: `make test-target TARGET=test_raw_transaction`
test-target: load-env
Expand Down
Loading

0 comments on commit 6714e35

Please sign in to comment.