From 68aff728b88bc5677aa11484ac998e13df63bd65 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Mon, 30 Dec 2024 16:44:51 +0100 Subject: [PATCH] feat: update revm 19 alloy 09 (#9605) * feat: update revm 19 alloy 09 * clippy * updata test * add back max data gas check --- Cargo.lock | 164 ++++++++++--------- Cargo.toml | 58 +++---- crates/anvil/core/src/eth/block.rs | 5 - crates/anvil/core/src/eth/transaction/mod.rs | 9 +- crates/anvil/src/config.rs | 7 +- crates/anvil/src/eth/api.rs | 2 +- crates/anvil/src/eth/backend/executor.rs | 6 +- crates/anvil/src/eth/backend/mem/mod.rs | 20 +-- crates/anvil/src/eth/backend/mem/storage.rs | 7 +- crates/anvil/src/eth/error.rs | 7 +- crates/anvil/src/eth/fees.rs | 11 +- crates/anvil/src/eth/otterscan/api.rs | 2 +- crates/anvil/tests/it/eip4844.rs | 6 +- crates/anvil/tests/it/eip7702.rs | 4 +- crates/anvil/tests/it/fork.rs | 4 +- crates/cast/bin/cmd/wallet/mod.rs | 4 +- crates/cast/bin/tx.rs | 9 +- crates/cast/tests/cli/main.rs | 1 - crates/cheatcodes/src/evm.rs | 5 +- crates/cheatcodes/src/script.rs | 8 +- crates/common/fmt/src/ui.rs | 6 +- crates/evm/core/src/backend/mod.rs | 3 +- crates/evm/evm/src/executors/mod.rs | 4 +- crates/script/src/broadcast.rs | 4 +- crates/script/src/receipts.rs | 2 +- 25 files changed, 181 insertions(+), 177 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2ff45031d5f1..29742a2a1a8d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -86,9 +86,9 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88e1edea70787c33e11197d3f32ae380f3db19e6e061e539a5bcf8184a6b326" +checksum = "db66918860ff33920fb9e6d648d1e8cee275321406ea255ac9320f6562e26fec" dependencies = [ "alloy-eips", "alloy-primitives", @@ -104,9 +104,9 @@ dependencies = [ [[package]] name = "alloy-consensus-any" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57b1bb53f40c0273cd1975573cd457b39213e68584e36d1401d25fd0398a1d65" +checksum = "04519b5157de8a2166bddb07d84a63590100f1d3e2b3682144e787f1c27ccdac" dependencies = [ "alloy-consensus", "alloy-eips", @@ -118,9 +118,9 @@ dependencies = [ [[package]] name = "alloy-contract" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b668c78c4b1f12f474ede5a85e8ce550d0aa1ef7d49fd1d22855a43b960e725" +checksum = "8ff00ab4dd371f53e648d65bd5af01057bdad8aaae8b3cd7cee75445575995c1" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -173,9 +173,9 @@ dependencies = [ [[package]] name = "alloy-eip7702" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c986539255fb839d1533c128e190e557e52ff652c9ef62939e233a81dd93f7e" +checksum = "cabf647eb4650c91a9d38cb6f972bb320009e7e9d61765fb688a86f1563b33e8" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -188,9 +188,9 @@ dependencies = [ [[package]] name = "alloy-eips" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9fadfe089e9ccc0650473f2d4ef0a28bc015bbca5631d9f0f09e49b557fdb3" +checksum = "e56518f46b074d562ac345238343e2231b672a13aca18142d285f95cc055980b" dependencies = [ "alloy-eip2930", "alloy-eip7702", @@ -206,10 +206,11 @@ dependencies = [ [[package]] name = "alloy-genesis" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2a4cf7b70f3495788e74ce1c765260ffe38820a2a774ff4aacb62e31ea73f9" +checksum = "2cf200fd4c28435995e47b26d4761a4cf6e1011a13b81f9a9afaf16a93d9fd09" dependencies = [ + "alloy-eips", "alloy-primitives", "alloy-serde", "alloy-trie", @@ -230,9 +231,9 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e29040b9d5fe2fb70415531882685b64f8efd08dfbd6cc907120650504821105" +checksum = "b17c5ada5faf0f9d2921e8b20971eced68abbc92a272b0502cac8b1d00f56777" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -244,9 +245,9 @@ dependencies = [ [[package]] name = "alloy-network" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "510cc00b318db0dfccfdd2d032411cfae64fc144aef9679409e014145d3dacc4" +checksum = "24f3117647e3262f6db9e18b371bf67c5810270c0cf915786c30fad3b1739561" dependencies = [ "alloy-consensus", "alloy-consensus-any", @@ -269,9 +270,9 @@ dependencies = [ [[package]] name = "alloy-network-primitives" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9081c099e798b8a2bba2145eb82a9a146f01fc7a35e9ab6e7b43305051f97550" +checksum = "1535a4577648ec2fd3c446d4644d9b8e9e01e5816be53a5d515dc1624e2227b2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -282,9 +283,9 @@ dependencies = [ [[package]] name = "alloy-node-bindings" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef9849fb8bbb28f69f2cbdb4b0dac2f0e35c04f6078a00dfb8486469aed02de" +checksum = "bf741e871fb62c80e0007041e8bc1e81978abfd98aafea8354472f06bfd4d309" dependencies = [ "alloy-genesis", "alloy-primitives", @@ -331,9 +332,9 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc2dfaddd9a30aa870a78a4e1316e3e115ec1e12e552cbc881310456b85c1f24" +checksum = "fcfa2db03d4221b5ca14bff7dbed4712689cb87a3e826af522468783ff05ec5d" dependencies = [ "alloy-chains", "alloy-consensus", @@ -374,9 +375,9 @@ dependencies = [ [[package]] name = "alloy-pubsub" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "695809e743628d54510c294ad17a4645bd9f465aeb0d20ee9ce9877c9712dc9c" +checksum = "4eace70e43b073d4bfc1de915c45993a50facd6526fd8da80204e0f83a9e233a" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -415,9 +416,9 @@ dependencies = [ [[package]] name = "alloy-rpc-client" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531137b283547d5b9a5cafc96b006c64ef76810c681d606f28be9781955293b6" +checksum = "d2ec6963b08f1c6ef8eacc01dbba20f2c6a1533550403f6b52dbbe0da0360834" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -441,9 +442,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3410a472ce26c457e9780f708ee6bd540b30f88f1f31fdab7a11d00bd6aa1aee" +checksum = "138ef78340b47f16ca4d04a4d75fe2ccdb3f1a4f748d5f3b2fbebc43581fd02e" dependencies = [ "alloy-primitives", "alloy-rpc-types-anvil", @@ -457,9 +458,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-anvil" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed06bd8a5fc57b352a6cbac24eec52a4760f08ae2c1eb56ac49c8ed4b02c351" +checksum = "efbe94a1fcd071f19b313e4506d1affee0bd0b4a1cfbfd18a2541fda8e5487cf" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", @@ -469,9 +470,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-any" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed98e1af55a7d856bfa385f30f63d8d56be2513593655c904a8f4a7ec963aa3e" +checksum = "c64a83112b09bd293ef522bfa3800fa2d2df4d72f2bcd3a84b08490503b22e55" dependencies = [ "alloy-consensus-any", "alloy-rpc-types-eth", @@ -480,9 +481,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-debug" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1dec1c1b65614ebd5834a7dfddf525a186962082023718e10f4f64ed2d02514" +checksum = "3cb36f68cc0c83120ecfbf0b1862b35f846da8e0cb95be3d10a3a08bfa711248" dependencies = [ "alloy-primitives", "serde", @@ -490,9 +491,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-engine" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03bd16fa4959255ebf4a7702df08f325e5631df5cdca07c8a8e58bdc10fe02e3" +checksum = "2c9d87e5622ed4d471f1eefb99a400cd7e362a1889baa9bb4417742260ca43a8" dependencies = [ "alloy-consensus", "alloy-eips", @@ -508,9 +509,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8737d7a6e37ca7bba9c23e9495c6534caec6760eb24abc9d5ffbaaba147818e1" +checksum = "5fc1892a1ac0d2a49c063f0791aa6bde342f020c5d37aaaec14832b661802cb4" dependencies = [ "alloy-consensus", "alloy-consensus-any", @@ -520,17 +521,17 @@ dependencies = [ "alloy-rlp", "alloy-serde", "alloy-sol-types", - "derive_more", "itertools 0.13.0", "serde", "serde_json", + "thiserror 2.0.9", ] [[package]] name = "alloy-rpc-types-trace" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db14a83665cd28ffd01939f04c2adf0e0fd9bb648b73ca651dcaa0869dae027f" +checksum = "b25a5e0a7ae0127f20077b23319c8d4a416187c204bf3329ab28a0309ed45535" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", @@ -542,9 +543,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-txpool" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a574e97dff62097d22d6cd360f898f3d069239ca0ca7bfc2e5e7b22815ec572" +checksum = "64952ac1199868bcd05b3aae2d5e988e6bd171e42ae71580abe6718263061b27" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", @@ -554,9 +555,9 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5851bf8d5ad33014bd0c45153c603303e730acc8a209450a7ae6b4a12c2789e2" +checksum = "17939f6bef49268e4494158fce1ab8913cd6164ec3f9a4ada2c677b9b5a77f2f" dependencies = [ "alloy-primitives", "serde", @@ -565,9 +566,9 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e10ca565da6500cca015ba35ee424d59798f2e1b85bc0dd8f81dafd401f029a" +checksum = "77d1f0762a44338f0e05987103bd5919df52170d949080bfebfeb6aaaa867c39" dependencies = [ "alloy-dyn-abi", "alloy-primitives", @@ -581,9 +582,9 @@ dependencies = [ [[package]] name = "alloy-signer-aws" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e774d4203ad7dbeba06876c8528a169b7cb56770bd900bc061e6a2c2756a736" +checksum = "63cf9487165bcf15e15f033529ca8b8c63a26e5f9b435fbd239f786391ca2cb3" dependencies = [ "alloy-consensus", "alloy-network", @@ -599,9 +600,9 @@ dependencies = [ [[package]] name = "alloy-signer-gcp" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9843facd50077d2010ac0ef9e9176f8a06f2e2c8e653d83d82859803c623c6fc" +checksum = "2a9f720296bf196732ecc6717aae33a4192c430b779b709557073329ae7ebeb4" dependencies = [ "alloy-consensus", "alloy-network", @@ -617,9 +618,9 @@ dependencies = [ [[package]] name = "alloy-signer-ledger" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08367716d2eee6f15f0f7ee2e855decbfedd12be12fe5f490a2d2717deda95bf" +checksum = "3eaa7c88f704957cd9a8021be4d9e1d12da2cea55b8ce0551224805520ab0720" dependencies = [ "alloy-consensus", "alloy-dyn-abi", @@ -637,9 +638,9 @@ dependencies = [ [[package]] name = "alloy-signer-local" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47fababf5a745133490cde927d48e50267f97d3d1209b9fc9f1d1d666964d172" +checksum = "59dd2f16055f532f83a8f8e3c13cf1e3b5ff78afdef82edb613946156e542272" dependencies = [ "alloy-consensus", "alloy-network", @@ -656,9 +657,9 @@ dependencies = [ [[package]] name = "alloy-signer-trezor" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfbd920ad5dc03e1904827d30fd2ed874968c33885e254b2c2f59503b33e4bb8" +checksum = "9bd52d50f219e5160799cc569c1a7efd20d4d92cc2c2352a59874f71f02d642c" dependencies = [ "alloy-consensus", "alloy-network", @@ -746,9 +747,9 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "538a04a37221469cac0ce231b737fd174de2fdfcdd843bdd068cb39ed3e066ad" +checksum = "3a3827275a4eed3431ce876a59c76fd19effc2a8c09566b2603e3a3376d38af0" dependencies = [ "alloy-json-rpc", "base64 0.22.1", @@ -766,9 +767,9 @@ dependencies = [ [[package]] name = "alloy-transport-http" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ed40eb1e1265b2911512f6aa1dcece9702d078f5a646730c45e39e2be00ac1c" +checksum = "958417ddf333c55b0627cb7fbee7c6666895061dee79f50404dd6dbdd8e9eba0" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -781,9 +782,9 @@ dependencies = [ [[package]] name = "alloy-transport-ipc" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a172a59d24706b26a79a837f86d51745cb26ca6f8524712acd0208a14cff95" +checksum = "168abcf4337c3fbc0bf9030e62bbaca8b9a0fddf687ecc6585e2e6515dde8b0d" dependencies = [ "alloy-json-rpc", "alloy-pubsub", @@ -802,9 +803,9 @@ dependencies = [ [[package]] name = "alloy-transport-ws" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba0e39d181d13c266dbb8ca54ed584a2c66d6e9279afca89c7a6b1825e98abb" +checksum = "fcaf327f8d3e938272c2eace672094d3800e069e3f34137358e563faaa314f8a" dependencies = [ "alloy-pubsub", "alloy-transport", @@ -4171,9 +4172,9 @@ dependencies = [ [[package]] name = "foundry-fork-db" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "491e9f9f138086b3627a8c406730dfbb6afcdcf688e6da0eb15df52f0c8ed163" +checksum = "89a794c8a78ba20568a0c86b035768da7e81fed3c51cecea57f81523123cbcfa" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -6372,9 +6373,9 @@ checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "op-alloy-consensus" -version = "0.8.5" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c698f80ee53e56d1b60a97e9d90ad09788b516c964c9c97fb5927860b812ef0d" +checksum = "0adb232ec805af3aa35606c19329aa7dc44c4457ae318ed0b8fc7f799dd7dbfe" dependencies = [ "alloy-consensus", "alloy-eips", @@ -6388,9 +6389,9 @@ dependencies = [ [[package]] name = "op-alloy-rpc-types" -version = "0.8.5" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aef2128fe8979596b3a1f79a2454f3e32fd239889a03d50fe686b9a2f30a16" +checksum = "e68d1a51fe3ee143f102b82f54fa237f21d12635da363276901e6d3ef6c65b7b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7492,13 +7493,14 @@ dependencies = [ [[package]] name = "revm" -version = "18.0.0" +version = "19.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15689a3c6a8d14b647b4666f2e236ef47b5a5133cdfd423f545947986fff7013" +checksum = "e8905d0c5f10e767f13ea7cb8e502d315f144071a60fe2bd83977922dd3afa26" dependencies = [ "auto_impl", "cfg-if", "dyn-clone", + "once_cell", "revm-interpreter", "revm-precompile", "serde", @@ -7507,9 +7509,9 @@ dependencies = [ [[package]] name = "revm-inspectors" -version = "0.13.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d056aaa21f36038ab35fe8ce940ee332903a0b4b992b8ca805fb60c85eb2086" +checksum = "dc873bc873e12a1723493e1a35804fa79b673a0bfb1c19cfee659d46def8be42" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", @@ -7525,9 +7527,9 @@ dependencies = [ [[package]] name = "revm-interpreter" -version = "14.0.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74e3f11d0fed049a4a10f79820c59113a79b38aed4ebec786a79d5c667bfeb51" +checksum = "e5ff76b50b5a9fa861fbc236fc82ce1afdf58861f65012aea807d679e54630d6" dependencies = [ "revm-primitives", "serde", @@ -7535,9 +7537,9 @@ dependencies = [ [[package]] name = "revm-precompile" -version = "15.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e381060af24b750069a2b2d2c54bba273d84e8f5f9e8026fc9262298e26cc336" +checksum = "6542fb37650dfdbf4b9186769e49c4a8bc1901a3280b2ebf32f915b6c8850f36" dependencies = [ "aurora-engine-modexp", "blst", @@ -7555,9 +7557,9 @@ dependencies = [ [[package]] name = "revm-primitives" -version = "14.0.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3702f132bb484f4f0d0ca4f6fbde3c82cfd745041abbedd6eda67730e1868ef0" +checksum = "48faea1ecf2c9f80d9b043bbde0db9da616431faed84c4cfa3dd7393005598e6" dependencies = [ "alloy-eip2930", "alloy-eip7702", diff --git a/Cargo.toml b/Cargo.toml index 01a6eaa7de56..d4ccda8e5564 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -172,43 +172,43 @@ foundry-linking = { path = "crates/linking" } # solc & compilation utilities foundry-block-explorers = { version = "0.9.0", default-features = false } foundry-compilers = { version = "0.12.8", default-features = false } -foundry-fork-db = "0.9.0" +foundry-fork-db = "0.10.0" solang-parser = "=0.3.3" solar-ast = { version = "=0.1.0", default-features = false } solar-parse = { version = "=0.1.0", default-features = false } ## revm -revm = { version = "18.0.0", default-features = false } -revm-primitives = { version = "14.0.0", default-features = false } -revm-inspectors = { version = "0.13.0", features = ["serde"] } +revm = { version = "19.0.0", default-features = false } +revm-primitives = { version = "15.1.0", default-features = false } +revm-inspectors = { version = "0.14.1", features = ["serde"] } ## ethers ethers-contract-abigen = { version = "2.0.14", default-features = false } ## alloy -alloy-consensus = { version = "0.8.0", default-features = false } -alloy-contract = { version = "0.8.0", default-features = false } -alloy-eips = { version = "0.8.0", default-features = false } -alloy-genesis = { version = "0.8.0", default-features = false } -alloy-json-rpc = { version = "0.8.0", default-features = false } -alloy-network = { version = "0.8.0", default-features = false } -alloy-provider = { version = "0.8.0", default-features = false } -alloy-pubsub = { version = "0.8.0", default-features = false } -alloy-rpc-client = { version = "0.8.0", default-features = false } -alloy-rpc-types = { version = "0.8.0", default-features = true } -alloy-serde = { version = "0.8.0", default-features = false } -alloy-signer = { version = "0.8.0", default-features = false } -alloy-signer-aws = { version = "0.8.0", default-features = false } -alloy-signer-gcp = { version = "0.8.0", default-features = false } -alloy-signer-ledger = { version = "0.8.0", default-features = false } -alloy-signer-local = { version = "0.8.0", default-features = false } -alloy-signer-trezor = { version = "0.8.0", default-features = false } -alloy-transport = { version = "0.8.0", default-features = false } -alloy-transport-http = { version = "0.8.0", default-features = false } -alloy-transport-ipc = { version = "0.8.0", default-features = false } -alloy-transport-ws = { version = "0.8.0", default-features = false } -alloy-node-bindings = { version = "0.8.0", default-features = false } -alloy-network-primitives = { version = "0.8.0", default-features = false } +alloy-consensus = { version = "0.9.0", default-features = false } +alloy-contract = { version = "0.9.0", default-features = false } +alloy-eips = { version = "0.9.0", default-features = false } +alloy-genesis = { version = "0.9.0", default-features = false } +alloy-json-rpc = { version = "0.9.0", default-features = false } +alloy-network = { version = "0.9.0", default-features = false } +alloy-provider = { version = "0.9.0", default-features = false } +alloy-pubsub = { version = "0.9.0", default-features = false } +alloy-rpc-client = { version = "0.9.0", default-features = false } +alloy-rpc-types = { version = "0.9.0", default-features = true } +alloy-serde = { version = "0.9.0", default-features = false } +alloy-signer = { version = "0.9.0", default-features = false } +alloy-signer-aws = { version = "0.9.0", default-features = false } +alloy-signer-gcp = { version = "0.9.0", default-features = false } +alloy-signer-ledger = { version = "0.9.0", default-features = false } +alloy-signer-local = { version = "0.9.0", default-features = false } +alloy-signer-trezor = { version = "0.9.0", default-features = false } +alloy-transport = { version = "0.9.0", default-features = false } +alloy-transport-http = { version = "0.9.0", default-features = false } +alloy-transport-ipc = { version = "0.9.0", default-features = false } +alloy-transport-ws = { version = "0.9.0", default-features = false } +alloy-node-bindings = { version = "0.9.0", default-features = false } +alloy-network-primitives = { version = "0.9.0", default-features = false } ## alloy-core alloy-dyn-abi = "0.8.14" @@ -228,8 +228,8 @@ alloy-rlp = "0.3" alloy-trie = "0.7.0" ## op-alloy -op-alloy-rpc-types = "0.8.0" -op-alloy-consensus = "0.8.0" +op-alloy-rpc-types = "0.9.0" +op-alloy-consensus = "0.9.0" ## cli anstream = "0.6" diff --git a/crates/anvil/core/src/eth/block.rs b/crates/anvil/core/src/eth/block.rs index 50a9a66b331f..c9f9048b8199 100644 --- a/crates/anvil/core/src/eth/block.rs +++ b/crates/anvil/core/src/eth/block.rs @@ -65,7 +65,6 @@ impl Block { nonce: partial_header.nonce, base_fee_per_gas: partial_header.base_fee, requests_hash: partial_header.requests_hash, - target_blobs_per_block: None, }, transactions, ommers: vec![], @@ -158,7 +157,6 @@ mod tests { parent_beacon_block_root: Default::default(), base_fee_per_gas: None, requests_hash: None, - target_blobs_per_block: None, }; let encoded = alloy_rlp::encode(&header); @@ -200,7 +198,6 @@ mod tests { nonce: B64::ZERO, base_fee_per_gas: None, requests_hash: None, - target_blobs_per_block: None, }; header.encode(&mut data); @@ -234,7 +231,6 @@ mod tests { parent_beacon_block_root: None, base_fee_per_gas: None, requests_hash: None, - target_blobs_per_block: None, }; let header = Header::decode(&mut data.as_slice()).unwrap(); assert_eq!(header, expected); @@ -267,7 +263,6 @@ mod tests { excess_blob_gas: None, parent_beacon_block_root: None, requests_hash: None, - target_blobs_per_block: None, }; assert_eq!(header.hash_slow(), expected_hash); } diff --git a/crates/anvil/core/src/eth/transaction/mod.rs b/crates/anvil/core/src/eth/transaction/mod.rs index 29b8aee88d3c..38eda60405d4 100644 --- a/crates/anvil/core/src/eth/transaction/mod.rs +++ b/crates/anvil/core/src/eth/transaction/mod.rs @@ -619,7 +619,6 @@ impl TryFrom for TypedTransaction { TxEnvelope::Eip1559(tx) => Ok(Self::EIP1559(tx)), TxEnvelope::Eip4844(tx) => Ok(Self::EIP4844(tx)), TxEnvelope::Eip7702(tx) => Ok(Self::EIP7702(tx)), - _ => Err(ConversionError::Custom("UnsupportedTxType".to_string())), }, AnyTxEnvelope::Unknown(mut tx) => { // Try to convert to deposit transaction @@ -1260,7 +1259,7 @@ impl From>> for OtsReceipt { } as u8; let receipt = ReceiptWithBloom::>::from(value); let status = receipt.status(); - let cumulative_gas_used = receipt.cumulative_gas_used() as u64; + let cumulative_gas_used = receipt.cumulative_gas_used(); let logs = receipt.logs().to_vec(); let logs_bloom = receipt.logs_bloom; @@ -1269,7 +1268,7 @@ impl From>> for OtsReceipt { } impl TypedReceipt { - pub fn cumulative_gas_used(&self) -> u128 { + pub fn cumulative_gas_used(&self) -> u64 { self.as_receipt_with_bloom().cumulative_gas_used() } @@ -1653,7 +1652,7 @@ mod tests { let receipt = TypedReceipt::Legacy(ReceiptWithBloom { receipt: Receipt { status: false.into(), - cumulative_gas_used: 0x1u128, + cumulative_gas_used: 0x1, logs: vec![Log { address: Address::from_str("0000000000000000000000000000000000000011").unwrap(), data: LogData::new_unchecked( @@ -1688,7 +1687,7 @@ mod tests { let expected = TypedReceipt::Legacy(ReceiptWithBloom { receipt: Receipt { status: false.into(), - cumulative_gas_used: 0x1u128, + cumulative_gas_used: 0x1, logs: vec![Log { address: Address::from_str("0000000000000000000000000000000000000011").unwrap(), data: LogData::new_unchecked( diff --git a/crates/anvil/src/config.rs b/crates/anvil/src/config.rs index 7ed1432fdcd6..247586bfdcc3 100644 --- a/crates/anvil/src/config.rs +++ b/crates/anvil/src/config.rs @@ -498,10 +498,10 @@ impl NodeConfig { blob_excess_gas_and_price.clone() } else if let Some(excess_blob_gas) = self.genesis.as_ref().and_then(|g| g.excess_blob_gas) { - BlobExcessGasAndPrice::new(excess_blob_gas as u64) + BlobExcessGasAndPrice::new(excess_blob_gas, false) } else { // If no excess blob gas is configured, default to 0 - BlobExcessGasAndPrice::new(0) + BlobExcessGasAndPrice::new(0, false) } } @@ -1213,11 +1213,12 @@ latest block number: {latest_block}" (block.header.excess_blob_gas, block.header.blob_gas_used) { env.block.blob_excess_gas_and_price = - Some(BlobExcessGasAndPrice::new(blob_excess_gas)); + Some(BlobExcessGasAndPrice::new(blob_excess_gas, false)); let next_block_blob_excess_gas = fees .get_next_block_blob_excess_gas(blob_excess_gas as u128, blob_gas_used as u128); fees.set_blob_excess_gas_and_price(BlobExcessGasAndPrice::new( next_block_blob_excess_gas, + false, )); } } diff --git a/crates/anvil/src/eth/api.rs b/crates/anvil/src/eth/api.rs index daf9dc4a00f4..23aac7452913 100644 --- a/crates/anvil/src/eth/api.rs +++ b/crates/anvil/src/eth/api.rs @@ -2315,7 +2315,7 @@ impl EthApi { let to = tx.to(); let gas_price = tx.gas_price(); let value = tx.value(); - let gas = tx.gas_limit() as u128; + let gas = tx.gas_limit(); TxpoolInspectSummary { to, value, gas, gas_price } } diff --git a/crates/anvil/src/eth/backend/executor.rs b/crates/anvil/src/eth/backend/executor.rs index f4b20868f295..c07bfab785e2 100644 --- a/crates/anvil/src/eth/backend/executor.rs +++ b/crates/anvil/src/eth/backend/executor.rs @@ -30,7 +30,7 @@ use foundry_evm::{ traces::CallTraceNode, utils::odyssey_handler_register, }; -use revm::{db::WrapDatabaseRef, primitives::MAX_BLOB_GAS_PER_BLOCK}; +use revm::db::WrapDatabaseRef; use std::sync::Arc; /// Represents an executed transaction (transacted on the DB) @@ -57,7 +57,7 @@ impl ExecutedTransaction { let status_code = u8::from(self.exit_reason as u8 <= InstructionResult::SelfDestruct as u8); let receipt_with_bloom: ReceiptWithBloom = Receipt { status: (status_code == 1).into(), - cumulative_gas_used: *cumulative_gas_used as u128, + cumulative_gas_used: *cumulative_gas_used, logs, } .into(); @@ -288,7 +288,7 @@ impl Iterator for &mut TransactionExec let max_blob_gas = self.blob_gas_used.saturating_add( transaction.pending_transaction.transaction.transaction.blob_gas().unwrap_or(0), ); - if max_blob_gas > MAX_BLOB_GAS_PER_BLOCK { + if max_blob_gas > alloy_eips::eip4844::MAX_DATA_GAS_PER_BLOCK { return Some(TransactionExecutionOutcome::BlobGasExhausted(transaction)) } diff --git a/crates/anvil/src/eth/backend/mem/mod.rs b/crates/anvil/src/eth/backend/mem/mod.rs index dfd96c72391a..154dae504e20 100644 --- a/crates/anvil/src/eth/backend/mem/mod.rs +++ b/crates/anvil/src/eth/backend/mem/mod.rs @@ -97,9 +97,7 @@ use op_alloy_consensus::{TxDeposit, DEPOSIT_TX_TYPE_ID}; use parking_lot::{Mutex, RwLock}; use revm::{ db::WrapDatabaseRef, - primitives::{ - calc_blob_gasprice, BlobExcessGasAndPrice, HashMap, OptimismFields, ResultAndState, - }, + primitives::{BlobExcessGasAndPrice, HashMap, OptimismFields, ResultAndState}, }; use std::{ collections::BTreeMap, @@ -1289,8 +1287,10 @@ impl Backend { // update next base fee self.fees.set_base_fee(next_block_base_fee); - self.fees - .set_blob_excess_gas_and_price(BlobExcessGasAndPrice::new(next_block_excess_blob_gas)); + self.fees.set_blob_excess_gas_and_price(BlobExcessGasAndPrice::new( + next_block_excess_blob_gas, + false, + )); // notify all listeners self.notify_on_new_block(header, block_hash); @@ -2341,7 +2341,8 @@ impl Backend { // Cancun specific let excess_blob_gas = block.header.excess_blob_gas; - let blob_gas_price = calc_blob_gasprice(excess_blob_gas.unwrap_or_default()); + let blob_gas_price = + alloy_eips::eip4844::calc_blob_gasprice(excess_blob_gas.unwrap_or_default()); let blob_gas_used = transaction.blob_gas(); let effective_gas_price = match transaction.transaction { @@ -2409,14 +2410,14 @@ impl Backend { transaction_hash: info.transaction_hash, transaction_index: Some(info.transaction_index), block_number: Some(block.header.number), - gas_used: info.gas_used as u128, + gas_used: info.gas_used, contract_address: info.contract_address, effective_gas_price, block_hash: Some(block_hash), from: info.from, to: info.to, blob_gas_price: Some(blob_gas_price), - blob_gas_used: blob_gas_used.map(|g| g as u128), + blob_gas_used, authorization_list: None, }; @@ -2809,7 +2810,7 @@ impl TransactionValidator for Backend { // Ensure the tx does not exceed the max blobs per block. if blob_count > MAX_BLOBS_PER_BLOCK { - return Err(InvalidTransactionError::TooManyBlobs(MAX_BLOBS_PER_BLOCK, blob_count)) + return Err(InvalidTransactionError::TooManyBlobs(blob_count)) } // Check for any blob validation errors @@ -2984,7 +2985,6 @@ pub fn transaction_build( let new_signed = Signed::new_unchecked(t, sig, hash); AnyTxEnvelope::Ethereum(TxEnvelope::Eip7702(new_signed)) } - _ => unreachable!("unknown tx type"), }; let tx = Transaction { diff --git a/crates/anvil/src/eth/backend/mem/storage.rs b/crates/anvil/src/eth/backend/mem/storage.rs index 5635a7accbd4..46429d4532b1 100644 --- a/crates/anvil/src/eth/backend/mem/storage.rs +++ b/crates/anvil/src/eth/backend/mem/storage.rs @@ -556,10 +556,7 @@ impl MinedTransaction { GethDebugBuiltInTracerType::CallTracer => { return match tracer_config.into_call_config() { Ok(call_config) => Ok(GethTraceBuilder::new(self.info.traces.clone()) - .geth_call_traces( - call_config, - self.receipt.cumulative_gas_used() as u64, - ) + .geth_call_traces(call_config, self.receipt.cumulative_gas_used()) .into()), Err(e) => Err(RpcError::invalid_params(e.to_string()).into()), }; @@ -578,7 +575,7 @@ impl MinedTransaction { // default structlog tracer Ok(GethTraceBuilder::new(self.info.traces.clone()) .geth_traces( - self.receipt.cumulative_gas_used() as u64, + self.receipt.cumulative_gas_used(), self.info.out.clone().unwrap_or_default(), config, ) diff --git a/crates/anvil/src/eth/error.rs b/crates/anvil/src/eth/error.rs index dda9b8bb26a9..0c9723c40a65 100644 --- a/crates/anvil/src/eth/error.rs +++ b/crates/anvil/src/eth/error.rs @@ -246,8 +246,8 @@ pub enum InvalidTransactionError { /// Thrown when there are no `blob_hashes` in the transaction, and it is an EIP-4844 tx. #[error("`blob_hashes` are required for EIP-4844 transactions")] NoBlobHashes, - #[error("too many blobs in one transaction, max: {0}, have: {1}")] - TooManyBlobs(usize, usize), + #[error("too many blobs in one transaction, have: {0}")] + TooManyBlobs(usize), /// Thrown when there's a blob validation error #[error(transparent)] BlobTransactionValidationError(#[from] alloy_consensus::BlobTransactionValidationError), @@ -297,7 +297,7 @@ impl From for InvalidTransactionError { InvalidTransaction::BlobCreateTransaction => Self::BlobCreateTransaction, InvalidTransaction::BlobVersionNotSupported => Self::BlobVersionNotSupported, InvalidTransaction::EmptyBlobs => Self::EmptyBlobs, - InvalidTransaction::TooManyBlobs { max, have } => Self::TooManyBlobs(max, have), + InvalidTransaction::TooManyBlobs { have } => Self::TooManyBlobs(have), InvalidTransaction::AuthorizationListNotSupported => { Self::AuthorizationListNotSupported } @@ -305,6 +305,7 @@ impl From for InvalidTransactionError { InvalidTransaction::OptimismError(_) | InvalidTransaction::EofCrateShouldHaveToAddress | InvalidTransaction::EmptyAuthorizationList => Self::Revm(err), + InvalidTransaction::GasFloorMoreThanGasLimit => Self::Revm(err), } } } diff --git a/crates/anvil/src/eth/fees.rs b/crates/anvil/src/eth/fees.rs index f41c51505ff6..bb405f62d1ef 100644 --- a/crates/anvil/src/eth/fees.rs +++ b/crates/anvil/src/eth/fees.rs @@ -5,6 +5,7 @@ use crate::eth::{ use alloy_consensus::Header; use alloy_eips::{ calc_next_block_base_fee, eip1559::BaseFeeParams, eip4844::MAX_DATA_GAS_PER_BLOCK, + eip7840::BlobParams, }; use alloy_primitives::B256; use anvil_core::eth::transaction::TypedTransaction; @@ -172,7 +173,7 @@ impl FeeManager { /// Calculates the next block blob base fee, using the provided excess blob gas pub fn get_next_block_blob_base_fee_per_gas(&self, excess_blob_gas: u128) -> u128 { - crate::revm::primitives::calc_blob_gasprice(excess_blob_gas as u64) + alloy_eips::eip4844::calc_blob_gasprice(excess_blob_gas as u64) } /// Calculates the next block blob excess gas, using the provided parent blob gas used and @@ -182,7 +183,7 @@ impl FeeManager { blob_gas_used: u128, blob_excess_gas: u128, ) -> u64 { - crate::revm::primitives::calc_excess_blob_gas(blob_gas_used as u64, blob_excess_gas as u64) + alloy_eips::eip4844::calc_excess_blob_gas(blob_gas_used as u64, blob_excess_gas as u64) } } @@ -246,7 +247,7 @@ impl FeeHistoryService { let base_fee = header.base_fee_per_gas.map(|g| g as u128).unwrap_or_default(); let excess_blob_gas = header.excess_blob_gas.map(|g| g as u128); let blob_gas_used = header.blob_gas_used.map(|g| g as u128); - let base_fee_per_blob_gas = header.blob_fee(); + let base_fee_per_blob_gas = header.blob_fee(BlobParams::cancun()); let mut item = FeeHistoryCacheItem { base_fee, gas_used_ratio: 0f64, @@ -270,7 +271,7 @@ impl FeeHistoryService { blob_gas_used.map(|g| g / MAX_DATA_GAS_PER_BLOCK as f64).unwrap_or(0 as f64); // extract useful tx info (gas_used, effective_reward) - let mut transactions: Vec<(u128, u128)> = receipts + let mut transactions: Vec<(_, _)> = receipts .iter() .enumerate() .map(|(i, receipt)| { @@ -312,7 +313,7 @@ impl FeeHistoryService { item.rewards = reward_percentiles .into_iter() .filter_map(|p| { - let target_gas = (p * gas_used / 100f64) as u128; + let target_gas = (p * gas_used / 100f64) as u64; let mut sum_gas = 0; for (gas_used, effective_reward) in transactions.iter().cloned() { sum_gas += gas_used; diff --git a/crates/anvil/src/eth/otterscan/api.rs b/crates/anvil/src/eth/otterscan/api.rs index f9a7334e0376..703c53b53a8d 100644 --- a/crates/anvil/src/eth/otterscan/api.rs +++ b/crates/anvil/src/eth/otterscan/api.rs @@ -384,7 +384,7 @@ impl EthApi { let total_fees = receipts .iter() - .fold(0, |acc, receipt| acc + receipt.gas_used * receipt.effective_gas_price); + .fold(0, |acc, receipt| acc + (receipt.gas_used as u128) * receipt.effective_gas_price); let Block { header, uncles, transactions, withdrawals } = block.inner; diff --git a/crates/anvil/tests/it/eip4844.rs b/crates/anvil/tests/it/eip4844.rs index ea195f000b6d..65bdba61163d 100644 --- a/crates/anvil/tests/it/eip4844.rs +++ b/crates/anvil/tests/it/eip4844.rs @@ -78,7 +78,7 @@ async fn can_send_multiple_blobs_in_one_tx() { let receipt = provider.send_transaction(tx).await.unwrap().get_receipt().await.unwrap(); - assert_eq!(receipt.blob_gas_used, Some(MAX_DATA_GAS_PER_BLOCK as u128)); + assert_eq!(receipt.blob_gas_used, Some(MAX_DATA_GAS_PER_BLOCK)); assert_eq!(receipt.blob_gas_price, Some(0x1)); // 1 wei } @@ -250,7 +250,7 @@ async fn can_correctly_estimate_blob_gas_with_recommended_fillers() { assert_eq!(receipt.to, Some(bob)); assert_eq!( receipt.blob_gas_used.expect("Expected to be EIP-4844 transaction"), - DATA_GAS_PER_BLOB as u128 + DATA_GAS_PER_BLOB ); } @@ -296,6 +296,6 @@ async fn can_correctly_estimate_blob_gas_with_recommended_fillers_with_signer() assert_eq!(receipt.to, Some(bob)); assert_eq!( receipt.blob_gas_used.expect("Expected to be EIP-4844 transaction"), - DATA_GAS_PER_BLOB as u128 + DATA_GAS_PER_BLOB ); } diff --git a/crates/anvil/tests/it/eip7702.rs b/crates/anvil/tests/it/eip7702.rs index e10633d6c14d..dfc93bfe08aa 100644 --- a/crates/anvil/tests/it/eip7702.rs +++ b/crates/anvil/tests/it/eip7702.rs @@ -1,7 +1,7 @@ use crate::utils::http_provider; use alloy_consensus::{transaction::TxEip7702, SignableTransaction}; use alloy_network::{ReceiptResponse, TransactionBuilder, TxSignerSync}; -use alloy_primitives::bytes; +use alloy_primitives::{bytes, U256}; use alloy_provider::Provider; use alloy_rpc_types::{Authorization, TransactionRequest}; use alloy_serde::WithOtherFields; @@ -44,7 +44,7 @@ async fn can_send_eip7702_tx() { let contract = receipt.contract_address.unwrap(); let authorization = Authorization { - chain_id: 31337u64, + chain_id: U256::from(31337u64), address: contract, nonce: provider.get_transaction_count(from).await.unwrap(), }; diff --git a/crates/anvil/tests/it/fork.rs b/crates/anvil/tests/it/fork.rs index 8e7736b0df36..be91bbc126bf 100644 --- a/crates/anvil/tests/it/fork.rs +++ b/crates/anvil/tests/it/fork.rs @@ -1503,7 +1503,9 @@ async fn test_fork_get_account() { assert_eq!( alice_acc.balance, - alice_bal - (U256::from(142) + U256::from(receipt.gas_used * receipt.effective_gas_price)), + alice_bal - + (U256::from(142) + + U256::from(receipt.gas_used as u128 * receipt.effective_gas_price)), ); assert_eq!(alice_acc.nonce, alice_nonce + 1); diff --git a/crates/cast/bin/cmd/wallet/mod.rs b/crates/cast/bin/cmd/wallet/mod.rs index 7960cab6ea56..4234304f25bb 100644 --- a/crates/cast/bin/cmd/wallet/mod.rs +++ b/crates/cast/bin/cmd/wallet/mod.rs @@ -1,6 +1,6 @@ use alloy_chains::Chain; use alloy_dyn_abi::TypedData; -use alloy_primitives::{hex, Address, PrimitiveSignature as Signature, B256}; +use alloy_primitives::{hex, Address, PrimitiveSignature as Signature, B256, U256}; use alloy_provider::Provider; use alloy_signer::Signer; use alloy_signer_local::{ @@ -380,7 +380,7 @@ impl WalletSubcommands { } else { provider.get_chain_id().await? }; - let auth = Authorization { chain_id, address, nonce }; + let auth = Authorization { chain_id: U256::from(chain_id), address, nonce }; let signature = wallet.sign_hash(&auth.signature_hash()).await?; let auth = auth.into_signed(signature); sh_println!("{}", hex::encode_prefixed(alloy_rlp::encode(&auth)))?; diff --git a/crates/cast/bin/tx.rs b/crates/cast/bin/tx.rs index 29f8e2435186..9cc98aedf4f9 100644 --- a/crates/cast/bin/tx.rs +++ b/crates/cast/bin/tx.rs @@ -3,7 +3,7 @@ use alloy_json_abi::Function; use alloy_network::{ AnyNetwork, TransactionBuilder, TransactionBuilder4844, TransactionBuilder7702, }; -use alloy_primitives::{hex, Address, Bytes, TxKind}; +use alloy_primitives::{hex, Address, Bytes, TxKind, U256}; use alloy_provider::Provider; use alloy_rpc_types::{AccessList, Authorization, TransactionInput, TransactionRequest}; use alloy_serde::WithOtherFields; @@ -379,8 +379,11 @@ where let auth = match auth { CliAuthorizationList::Address(address) => { - let auth = - Authorization { chain_id: self.chain.id(), nonce: tx_nonce + 1, address }; + let auth = Authorization { + chain_id: U256::from(self.chain.id()), + nonce: tx_nonce + 1, + address, + }; let Some(signer) = sender.as_signer() else { eyre::bail!("No signer available to sign authorization"); diff --git a/crates/cast/tests/cli/main.rs b/crates/cast/tests/cli/main.rs index c87c5f7f26de..f037cb166c47 100644 --- a/crates/cast/tests/cli/main.rs +++ b/crates/cast/tests/cli/main.rs @@ -105,7 +105,6 @@ totalDifficulty [..] blobGasUsed [..] excessBlobGas [..] requestsHash [..] -targetBlobsPerBlock [..] transactions: [ ... ] diff --git a/crates/cheatcodes/src/evm.rs b/crates/cheatcodes/src/evm.rs index 9f8eb27a489a..f9d648bca6db 100644 --- a/crates/cheatcodes/src/evm.rs +++ b/crates/cheatcodes/src/evm.rs @@ -485,7 +485,10 @@ impl Cheatcode for blobBaseFeeCall { "`blobBaseFee` is not supported before the Cancun hard fork; \ see EIP-4844: https://eips.ethereum.org/EIPS/eip-4844" ); - ccx.ecx.env.block.set_blob_excess_gas_and_price((*newBlobBaseFee).to()); + ccx.ecx.env.block.set_blob_excess_gas_and_price( + (*newBlobBaseFee).to(), + ccx.ecx.spec_id() >= SpecId::PRAGUE, + ); Ok(Default::default()) } } diff --git a/crates/cheatcodes/src/script.rs b/crates/cheatcodes/src/script.rs index b28141ae002e..0749d0d41ba4 100644 --- a/crates/cheatcodes/src/script.rs +++ b/crates/cheatcodes/src/script.rs @@ -40,7 +40,7 @@ impl Cheatcode for attachDelegationCall { let auth = Authorization { address: *implementation, nonce: *nonce, - chain_id: ccx.ecx.env.cfg.chain_id, + chain_id: U256::from(ccx.ecx.env.cfg.chain_id), }; let signed_auth = SignedAuthorization::new_unchecked( auth, @@ -87,7 +87,11 @@ fn create_auth( let authority_acc = ccx.ecx.journaled_state.load_account(authority, &mut ccx.ecx.db)?; let nonce = authority_acc.data.info.nonce; Ok(( - Authorization { address: implementation, nonce, chain_id: ccx.ecx.env.cfg.chain_id }, + Authorization { + address: implementation, + nonce, + chain_id: U256::from(ccx.ecx.env.cfg.chain_id), + }, nonce, )) } diff --git a/crates/common/fmt/src/ui.rs b/crates/common/fmt/src/ui.rs index af1bdd5df908..bd3dbbd42987 100644 --- a/crates/common/fmt/src/ui.rs +++ b/crates/common/fmt/src/ui.rs @@ -811,7 +811,6 @@ pub fn get_pretty_tx_attr(transaction: &Transaction, attr: &str) TxEnvelope::Eip4844(tx) => Some(tx.signature()), TxEnvelope::Eip7702(tx) => Some(tx.signature()), TxEnvelope::Legacy(tx) => Some(tx.signature()), - _ => None, }, _ => None, }; @@ -899,7 +898,6 @@ fn pretty_block_basics(block: &Block>) excess_blob_gas, parent_beacon_block_root, requests_hash, - target_blobs_per_block, }, }, uncles: _, @@ -931,8 +929,7 @@ withdrawalsRoot {} totalDifficulty {} blobGasUsed {} excessBlobGas {} -requestsHash {} -targetBlobsPerBlock {}", +requestsHash {}", base_fee_per_gas.pretty(), difficulty.pretty(), extra_data.pretty(), @@ -960,7 +957,6 @@ targetBlobsPerBlock {}", blob_gas_used.pretty(), excess_blob_gas.pretty(), requests_hash.pretty(), - target_blobs_per_block.pretty(), ) } diff --git a/crates/evm/core/src/backend/mod.rs b/crates/evm/core/src/backend/mod.rs index 3d162c96f46c..12f39b1ee029 100644 --- a/crates/evm/core/src/backend/mod.rs +++ b/crates/evm/core/src/backend/mod.rs @@ -1921,7 +1921,8 @@ fn update_env_block(env: &mut Env, block: &AnyRpcBlock) { env.block.gas_limit = U256::from(block.header.gas_limit); env.block.number = U256::from(block.header.number); if let Some(excess_blob_gas) = block.header.excess_blob_gas { - env.block.blob_excess_gas_and_price = Some(BlobExcessGasAndPrice::new(excess_blob_gas)); + env.block.blob_excess_gas_and_price = + Some(BlobExcessGasAndPrice::new(excess_blob_gas, false)); } } diff --git a/crates/evm/evm/src/executors/mod.rs b/crates/evm/evm/src/executors/mod.rs index ada7cc7b0666..187315d583c3 100644 --- a/crates/evm/evm/src/executors/mod.rs +++ b/crates/evm/evm/src/executors/mod.rs @@ -932,7 +932,7 @@ fn convert_executed_result( (reason.into(), 0_u64, gas_used, None, vec![]) } }; - let stipend = revm::interpreter::gas::validate_initial_tx_gas( + let gas = revm::interpreter::gas::calculate_initial_tx_gas( env.spec_id(), &env.tx.data, env.tx.transact_to.is_create(), @@ -964,7 +964,7 @@ fn convert_executed_result( result, gas_used, gas_refunded, - stipend, + stipend: gas.initial_gas, logs, labels, traces, diff --git a/crates/script/src/broadcast.rs b/crates/script/src/broadcast.rs index 207754e5c952..24368bc3d74c 100644 --- a/crates/script/src/broadcast.rs +++ b/crates/script/src/broadcast.rs @@ -413,11 +413,11 @@ impl BundledState { let (total_gas, total_gas_price, total_paid) = sequence.receipts.iter().fold((0, 0, 0), |acc, receipt| { let gas_used = receipt.gas_used; - let gas_price = receipt.effective_gas_price; + let gas_price = receipt.effective_gas_price as u64; (acc.0 + gas_used, acc.1 + gas_price, acc.2 + gas_used * gas_price) }); let paid = format_units(total_paid, 18).unwrap_or_else(|_| "N/A".to_string()); - let avg_gas_price = format_units(total_gas_price / sequence.receipts.len() as u128, 9) + let avg_gas_price = format_units(total_gas_price / sequence.receipts.len() as u64, 9) .unwrap_or_else(|_| "N/A".to_string()); seq_progress.inner.write().set_status(&format!( diff --git a/crates/script/src/receipts.rs b/crates/script/src/receipts.rs index cff893b55688..ee1c7b46c8c3 100644 --- a/crates/script/src/receipts.rs +++ b/crates/script/src/receipts.rs @@ -106,7 +106,7 @@ pub fn format_receipt(chain: Chain, receipt: &AnyTransactionReceipt) -> String { gas = if gas_price == 0 { format!("Gas Used: {gas_used}") } else { - let paid = format_units(gas_used.saturating_mul(gas_price), 18) + let paid = format_units((gas_used as u128).saturating_mul(gas_price), 18) .unwrap_or_else(|_| "N/A".into()); let gas_price = format_units(U256::from(gas_price), 9).unwrap_or_else(|_| "N/A".into());