Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
amsanghi committed Aug 5, 2024
1 parent a8c0734 commit 25b12e8
Show file tree
Hide file tree
Showing 27 changed files with 34 additions and 28 deletions.
6 changes: 6 additions & 0 deletions core/vm/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
6 changes: 3 additions & 3 deletions eth/tracers/internal/tracetest/calltrace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"purpose": "tip",
"from": null,
"to": "0x0000000000000000000000000000000000000000",
"value": "0x200b20"
"value": "0x0"
}
],
"from": "0x0c2c51a0990aee1d73c1228de158688341557508",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"purpose": "tip",
"from": null,
"to": "0xD049bfd667cB46Aa3Ef5Df0dA3e57DB3Be39E511",
"value": "0x2a0383e2a65c00"
"value": "0x0"
}
],
"from": "0x13e4acefe6a6700604929946e70e6443e4e73447",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"purpose": "tip",
"from": null,
"to": "0x1977C248e1014Cc103929Dd7f154199C916E39Ec",
"value": "0x700fefccd9800"
"value": "0x0"
}
],
"calls": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"purpose": "tip",
"from": null,
"to": "0x5659922cE141EedBC2733678f9806c77b4eEBEE8",
"value": "0x371a55e8d6800"
"value": "0x0"
}
],
"calls": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"purpose": "tip",
"from": null,
"to": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724",
"value": "0x2aa1efb94e0000"
"value": "0x0"
}
],
"calls": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"purpose": "tip",
"from": null,
"to": "0xc822ef32e6d26E170B70Cf761e204c1806265914",
"value": "0x216e3433f7200"
"value": "0x0"
}
],
"type": "CALL",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"purpose": "tip",
"from": null,
"to": "0x0000000000000000000000000000000000000000",
"value": "0x15bd3c0591000"
"value": "0x0"
}
],
"from": "0x3623191d4ccfbbdf09e8ebf6382a1f8257417bc1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"purpose": "tip",
"from": null,
"to": "0x00d8Ae40D9a06d0E7a2877B62E32eB959Afbe16D",
"value": "0x25ed5d81941000"
"value": "0x0"
}
],
"calls": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"purpose": "tip",
"from": null,
"to": "0xD049bfd667cB46Aa3Ef5Df0dA3e57DB3Be39E511",
"value": "0x49874422212000"
"value": "0x0"
}
],
"error": "out of gas",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"purpose": "tip",
"from": null,
"to": "0xF4D8e706CfB25c0DECBbDd4D2E2Cc10C66376a3F",
"value": "0x2954557199e00"
"value": "0x0"
}
],
"error": "execution reverted",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"purpose": "tip",
"from": null,
"to": "0x0000000000000000000000000000000000000000",
"value": "0x198f3fb76000"
"value": "0x0"
}
],
"error": "execution reverted",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"purpose": "tip",
"from": null,
"to": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724",
"value": "0x30cdd67dd6400"
"value": "0x0"
},
{
"purpose": "selfDestruct",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"purpose": "tip",
"from": null,
"to": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724",
"value": "0x420eed1bd6c00"
"value": "0x0"
}
],
"calls": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"purpose": "tip",
"from": null,
"to": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724",
"value": "0x420eed1bd6c00"
"value": "0x0"
}
],
"from": "0xb436ba50d378d4bbc8660d312a13df6af6e89dfb",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"purpose": "tip",
"from": null,
"to": "0x294e5d6c39A36Ce38aF1DCA70c1060f78Dee8070",
"value": "0x11c37937e08000"
"value": "0x0"
}
],
"error": "invalid jump destination",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"purpose": "tip",
"from": null,
"to": "0xf8b483DbA2c3B7176a3Da549ad41A48BB3121069",
"value": "0x119b54eb98e126"
"value": "0x0"
}
],
"from": "0x4f5777744b500616697cb655dcb02ee6cd51deb5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
"purpose": "tip",
"from": null,
"to": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
"value": "0xb9e774e8d5800"
"value": "0x0"
}
],
"from": "0x3de712784baf97260455ae25fb74f574ec9c1add",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"purpose": "tip",
"from": null,
"to": "0xe48430c4E88A929bBa0eE3DCe284866a9937b609",
"value": "0x6a8fb3d104cc00"
"value": "0x0"
}
],
"from": "0x0047a8033cc6d6ca2ed5044674fd421f44884de8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
"purpose": "tip",
"from": null,
"to": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
"value": "0xe25384e63aa600"
"value": "0x0"
}
],
"from": "0xbe3ae5cb97c253dda67181c6e34e43f5c275e08b",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
"purpose": "tip",
"from": null,
"to": "0x2a65Aca4D5fC5B5C859090a6c34d164135398226",
"value": "0x1b3dd214f1b8c00"
"value": "0x0"
}
],
"from": "0x3fcb0342353c541e210013aaddc2e740b9a33d08",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"purpose": "tip",
"from": null,
"to": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
"value": "0xb30d0148e0600"
"value": "0x0"
}
],
"from": "0x6412becf35cc7e2a9e7e47966e443f295e1e4f4a",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"purpose": "tip",
"from": null,
"to": "0xe2fE6B13287f28E193333fDfe7Fedf2f6Df6124A",
"value": "0x90886d609c400"
"value": "0x0"
}
],
"from": "0xd1220a0cf47c7b9be7a2e6ba89f429762e7b9adb",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
"purpose": "tip",
"from": null,
"to": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
"value": "0x81fc72632f7340"
"value": "0x0"
}
],
"from": "0xe6002189a74b43e6868b20c1311bc108e38aac57",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"purpose": "tip",
"from": null,
"to": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
"value": "0xbcd242cec0800"
"value": "0x0"
}
],
"from": "0x01115b41bd2731353dd3e6abf44818fdc035aaf1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"purpose": "tip",
"from": null,
"to": "0xf8b483DbA2c3B7176a3Da549ad41A48BB3121069",
"value": "0x119b54eb98e126"
"value": "0x0"
}
],
"from": "0x4f5777744b500616697cb655dcb02ee6cd51deb5",
Expand Down

0 comments on commit 25b12e8

Please sign in to comment.