diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 103c41856e..907dbb245c 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -112,6 +112,12 @@ var PrecompiledContractsCancun = map[common.Address]PrecompiledContract{ common.BytesToAddress([]byte{0xa}): &kzgPointEvaluation{}, } +// PrecompiledContractsP256Verify contains the precompiled Ethereum +// contract specified in EIP-7212. +var PrecompiledContractsP256Verify = map[common.Address]PrecompiledContract{ + common.BytesToAddress([]byte{0x01, 0x00}): &p256Verify{}, +} + // PrecompiledContractsPrague contains the set of pre-compiled Ethereum // contracts used in the Prague release. var PrecompiledContractsPrague = map[common.Address]PrecompiledContract{ diff --git a/eth/tracers/internal/tracetest/calltrace_test.go b/eth/tracers/internal/tracetest/calltrace_test.go index a682cf06af..3a4f4f9ee7 100644 --- a/eth/tracers/internal/tracetest/calltrace_test.go +++ b/eth/tracers/internal/tracetest/calltrace_test.go @@ -301,13 +301,13 @@ func TestInternals(t *testing.T) { byte(vm.CALL), }, tracer: mkTracer("callTracer", nil), - want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"feePayment","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"gasRefund","from":null,"to":"%s","value":"0xe3a8"},{"purpose":"tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x54d8"}],"from":"%s","gas":"0x13880","gasUsed":"0x54d8","to":"0x00000000000000000000000000000000deadbeef","input":"0x","calls":[{"from":"0x00000000000000000000000000000000deadbeef","gas":"0xe01a","gasUsed":"0x0","to":"0x00000000000000000000000000000000000000ff","input":"0x","value":"0x0","type":"CALL"}],"value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), originHex), + want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"feePayment","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"gasRefund","from":null,"to":"%s","value":"0xe3a8"},{"purpose":"tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x0"}],"from":"%s","gas":"0x13880","gasUsed":"0x54d8","to":"0x00000000000000000000000000000000deadbeef","input":"0x","calls":[{"from":"0x00000000000000000000000000000000deadbeef","gas":"0xe01a","gasUsed":"0x0","to":"0x00000000000000000000000000000000000000ff","input":"0x","value":"0x0","type":"CALL"}],"value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), originHex), }, { name: "Stack depletion in LOG0", code: []byte{byte(vm.LOG3)}, tracer: mkTracer("callTracer", json.RawMessage(`{ "withLog": true }`)), - want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"feePayment","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"gasRefund","from":null,"to":"%s","value":"0x0"},{"purpose":"tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x13880"}],"from":"%s","gas":"0x13880","gasUsed":"0x13880","to":"0x00000000000000000000000000000000deadbeef","input":"0x","error":"stack underflow (0 \u003c=\u003e 5)","value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), originHex), + want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"feePayment","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"gasRefund","from":null,"to":"%s","value":"0x0"},{"purpose":"tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x0"}],"from":"%s","gas":"0x13880","gasUsed":"0x13880","to":"0x00000000000000000000000000000000deadbeef","input":"0x","error":"stack underflow (0 \u003c=\u003e 5)","value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), originHex), }, { name: "Mem expansion in LOG0", @@ -320,7 +320,7 @@ func TestInternals(t *testing.T) { byte(vm.LOG0), }, tracer: mkTracer("callTracer", json.RawMessage(`{ "withLog": true }`)), - want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"feePayment","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"gasRefund","from":null,"to":"%s","value":"0xdce2"},{"purpose":"tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x5b9e"}],"from":"%s","gas":"0x13880","gasUsed":"0x5b9e","to":"0x00000000000000000000000000000000deadbeef","input":"0x","logs":[{"address":"0x00000000000000000000000000000000deadbeef","topics":[],"data":"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","position":"0x0"}],"value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), originHex), + want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"feePayment","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"gasRefund","from":null,"to":"%s","value":"0xdce2"},{"purpose":"tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x0"}],"from":"%s","gas":"0x13880","gasUsed":"0x5b9e","to":"0x00000000000000000000000000000000deadbeef","input":"0x","logs":[{"address":"0x00000000000000000000000000000000deadbeef","topics":[],"data":"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","position":"0x0"}],"value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), originHex), }, { // Leads to OOM on the prestate tracer diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/blob_tx.json b/eth/tracers/internal/tracetest/testdata/call_tracer/blob_tx.json index 9b48434e11..a78775b53a 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/blob_tx.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/blob_tx.json @@ -77,7 +77,7 @@ "purpose": "tip", "from": null, "to": "0x0000000000000000000000000000000000000000", - "value": "0x200b20" + "value": "0x0" } ], "from": "0x0c2c51a0990aee1d73c1228de158688341557508", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/create.json b/eth/tracers/internal/tracetest/testdata/call_tracer/create.json index 903ff57c57..39a82690c5 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/create.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/create.json @@ -65,7 +65,7 @@ "purpose": "tip", "from": null, "to": "0xD049bfd667cB46Aa3Ef5Df0dA3e57DB3Be39E511", - "value": "0x2a0383e2a65c00" + "value": "0x0" } ], "from": "0x13e4acefe6a6700604929946e70e6443e4e73447", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/deep_calls.json b/eth/tracers/internal/tracetest/testdata/call_tracer/deep_calls.json index a5cca5d434..0c39115b14 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/deep_calls.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/deep_calls.json @@ -128,7 +128,7 @@ "purpose": "tip", "from": null, "to": "0x1977C248e1014Cc103929Dd7f154199C916E39Ec", - "value": "0x700fefccd9800" + "value": "0x0" } ], "calls": [ diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/delegatecall.json b/eth/tracers/internal/tracetest/testdata/call_tracer/delegatecall.json index 26788a6ce4..04a22cf363 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/delegatecall.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/delegatecall.json @@ -81,7 +81,7 @@ "purpose": "tip", "from": null, "to": "0x5659922cE141EedBC2733678f9806c77b4eEBEE8", - "value": "0x371a55e8d6800" + "value": "0x0" } ], "calls": [ diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_create_oog_outer_throw.json b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_create_oog_outer_throw.json index 41d541761f..c449347bae 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_create_oog_outer_throw.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_create_oog_outer_throw.json @@ -73,7 +73,7 @@ "purpose": "tip", "from": null, "to": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", - "value": "0x2aa1efb94e0000" + "value": "0x0" } ], "calls": [ diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_instafail.json b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_instafail.json index 460c3d91b8..bf52a05f3e 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_instafail.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_instafail.json @@ -69,7 +69,7 @@ "purpose": "tip", "from": null, "to": "0xc822ef32e6d26E170B70Cf761e204c1806265914", - "value": "0x216e3433f7200" + "value": "0x0" } ], "type": "CALL", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_revert_reason.json b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_revert_reason.json index 2e06a33f5f..f792d62cf1 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_revert_reason.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_revert_reason.json @@ -69,7 +69,7 @@ "purpose": "tip", "from": null, "to": "0x0000000000000000000000000000000000000000", - "value": "0x15bd3c0591000" + "value": "0x0" } ], "from": "0x3623191d4ccfbbdf09e8ebf6382a1f8257417bc1", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_throw_outer_revert.json b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_throw_outer_revert.json index 9ebd222e29..6b5d6cac36 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_throw_outer_revert.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_throw_outer_revert.json @@ -76,7 +76,7 @@ "purpose": "tip", "from": null, "to": "0x00d8Ae40D9a06d0E7a2877B62E32eB959Afbe16D", - "value": "0x25ed5d81941000" + "value": "0x0" } ], "calls": [ diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/oog.json b/eth/tracers/internal/tracetest/testdata/call_tracer/oog.json index 8f11c63911..84e4ba7626 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/oog.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/oog.json @@ -67,7 +67,7 @@ "purpose": "tip", "from": null, "to": "0xD049bfd667cB46Aa3Ef5Df0dA3e57DB3Be39E511", - "value": "0x49874422212000" + "value": "0x0" } ], "error": "out of gas", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/revert.json b/eth/tracers/internal/tracetest/testdata/call_tracer/revert.json index 1ea1a8a55a..ebeab98fe3 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/revert.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/revert.json @@ -65,7 +65,7 @@ "purpose": "tip", "from": null, "to": "0xF4D8e706CfB25c0DECBbDd4D2E2Cc10C66376a3F", - "value": "0x2954557199e00" + "value": "0x0" } ], "error": "execution reverted", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/revert_reason.json b/eth/tracers/internal/tracetest/testdata/call_tracer/revert_reason.json index 610ecc9b4a..1a234038be 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/revert_reason.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/revert_reason.json @@ -70,7 +70,7 @@ "purpose": "tip", "from": null, "to": "0x0000000000000000000000000000000000000000", - "value": "0x198f3fb76000" + "value": "0x0" } ], "error": "execution reverted", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/selfdestruct.json b/eth/tracers/internal/tracetest/testdata/call_tracer/selfdestruct.json index eb16322eae..67237b44a1 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/selfdestruct.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/selfdestruct.json @@ -71,7 +71,7 @@ "purpose": "tip", "from": null, "to": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", - "value": "0x30cdd67dd6400" + "value": "0x0" }, { "purpose": "selfDestruct", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/simple.json b/eth/tracers/internal/tracetest/testdata/call_tracer/simple.json index 92f7a68a18..db8953b564 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/simple.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/simple.json @@ -76,7 +76,7 @@ "purpose": "tip", "from": null, "to": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", - "value": "0x420eed1bd6c00" + "value": "0x0" } ], "calls": [ diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/simple_onlytop.json b/eth/tracers/internal/tracetest/testdata/call_tracer/simple_onlytop.json index deb7d5cddf..317913cdbc 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/simple_onlytop.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/simple_onlytop.json @@ -79,7 +79,7 @@ "purpose": "tip", "from": null, "to": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", - "value": "0x420eed1bd6c00" + "value": "0x0" } ], "from": "0xb436ba50d378d4bbc8660d312a13df6af6e89dfb", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/throw.json b/eth/tracers/internal/tracetest/testdata/call_tracer/throw.json index 4bdfbd349b..4407bc69d0 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/throw.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/throw.json @@ -69,7 +69,7 @@ "purpose": "tip", "from": null, "to": "0x294e5d6c39A36Ce38aF1DCA70c1060f78Dee8070", - "value": "0x11c37937e08000" + "value": "0x0" } ], "error": "invalid jump destination", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/calldata.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/calldata.json index 53d561f395..b4b248f0eb 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/calldata.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/calldata.json @@ -95,7 +95,7 @@ "purpose": "tip", "from": null, "to": "0xf8b483DbA2c3B7176a3Da549ad41A48BB3121069", - "value": "0x119b54eb98e126" + "value": "0x0" } ], "from": "0x4f5777744b500616697cb655dcb02ee6cd51deb5", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/delegatecall.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/delegatecall.json index 288043d3da..fb089b01e4 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/delegatecall.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/delegatecall.json @@ -152,7 +152,7 @@ "purpose": "tip", "from": null, "to": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", - "value": "0xb9e774e8d5800" + "value": "0x0" } ], "from": "0x3de712784baf97260455ae25fb74f574ec9c1add", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/frontier_create_outofstorage.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/frontier_create_outofstorage.json index b2e1ea79cd..1e87fdae85 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/frontier_create_outofstorage.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/frontier_create_outofstorage.json @@ -98,7 +98,7 @@ "purpose": "tip", "from": null, "to": "0xe48430c4E88A929bBa0eE3DCe284866a9937b609", - "value": "0x6a8fb3d104cc00" + "value": "0x0" } ], "from": "0x0047a8033cc6d6ca2ed5044674fd421f44884de8", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multi_contracts.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multi_contracts.json index df7f7a8318..9594749fbc 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multi_contracts.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multi_contracts.json @@ -317,7 +317,7 @@ "purpose": "tip", "from": null, "to": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8", - "value": "0xe25384e63aa600" + "value": "0x0" } ], "from": "0xbe3ae5cb97c253dda67181c6e34e43f5c275e08b", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multilogs.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multilogs.json index 55848ae7ab..f1cad828a5 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multilogs.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multilogs.json @@ -185,7 +185,7 @@ "purpose": "tip", "from": null, "to": "0x2a65Aca4D5fC5B5C859090a6c34d164135398226", - "value": "0x1b3dd214f1b8c00" + "value": "0x0" } ], "from": "0x3fcb0342353c541e210013aaddc2e740b9a33d08", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/notopic.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/notopic.json index f2316eb1b9..8484e12bf4 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/notopic.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/notopic.json @@ -120,7 +120,7 @@ "purpose": "tip", "from": null, "to": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", - "value": "0xb30d0148e0600" + "value": "0x0" } ], "from": "0x6412becf35cc7e2a9e7e47966e443f295e1e4f4a", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/simple.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/simple.json index 82d0596304..5b031011f3 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/simple.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/simple.json @@ -81,7 +81,7 @@ "purpose": "tip", "from": null, "to": "0xe2fE6B13287f28E193333fDfe7Fedf2f6Df6124A", - "value": "0x90886d609c400" + "value": "0x0" } ], "from": "0xd1220a0cf47c7b9be7a2e6ba89f429762e7b9adb", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_failed.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_failed.json index 730fea23e1..c0157602cd 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_failed.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_failed.json @@ -155,7 +155,7 @@ "purpose": "tip", "from": null, "to": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8", - "value": "0x81fc72632f7340" + "value": "0x0" } ], "from": "0xe6002189a74b43e6868b20c1311bc108e38aac57", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_partial_failed.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_partial_failed.json index 8a46028598..fbe1bfc2d4 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_partial_failed.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_partial_failed.json @@ -93,7 +93,7 @@ "purpose": "tip", "from": null, "to": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", - "value": "0xbcd242cec0800" + "value": "0x0" } ], "from": "0x01115b41bd2731353dd3e6abf44818fdc035aaf1", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/with_onlyTopCall.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/with_onlyTopCall.json index 50b3b0b276..e4c05184ed 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/with_onlyTopCall.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/with_onlyTopCall.json @@ -96,7 +96,7 @@ "purpose": "tip", "from": null, "to": "0xf8b483DbA2c3B7176a3Da549ad41A48BB3121069", - "value": "0x119b54eb98e126" + "value": "0x0" } ], "from": "0x4f5777744b500616697cb655dcb02ee6cd51deb5",