Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/eip 7702 pick #234

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
bff8e4a
all: impl eip-7702
lightclient Jun 26, 2024
56c24d3
cmd/evm: add 7702 test for t8n
lightclient Oct 18, 2024
bd745b3
internal/ethapi: add 7702 tests to eth_estimateGas
lightclient Oct 29, 2024
8eb2124
core/vm: make 7702 variants of EXT* ops
lightclient Nov 21, 2024
f23002a
core: remove resolve code mechanism from statedb, put in vm
lightclient Nov 27, 2024
07b2def
core: use parse delegation for code check in state transition
lightclient Nov 27, 2024
be628b2
legacypool: don't allow 7702 txs in pool yet
lightclient Nov 27, 2024
c404f52
common: remove zero address
lightclient Nov 27, 2024
e586ef4
acounts/external: handle set code tx type in backend
lightclient Nov 27, 2024
6c6461b
internal/ethapi: handle set code tx type in transaction args
lightclient Nov 27, 2024
a82b012
core: clarify test a bit
holiman Nov 27, 2024
ab2dc28
core/types: remove AuthorizationList and use Authorization as value i…
fjl Dec 2, 2024
de7fc88
core/types: change Authorization signature value to uint256
fjl Dec 2, 2024
e486c3c
core/types: change Authority method to pointer receiver
fjl Dec 2, 2024
d6cd40f
internal/ethapi: remove reference to blob fields in setcode tx
fjl Dec 2, 2024
d41c4b4
core/types: improve authority signature handling
fjl Dec 2, 2024
0febf4d
core/vm: add comment about chained EIP-7702 delegations
fjl Dec 2, 2024
b4c4e14
core: remove debug print
fjl Dec 2, 2024
b8c6127
cmd/evm: update testdata
fjl Dec 2, 2024
ab44de4
graphql: add support for fee parameters of SetCodeTx
fjl Dec 2, 2024
863d8cd
core: improve checks for 7702
fjl Dec 2, 2024
745bb64
core: add comment about 7702 state transition error
fjl Dec 2, 2024
a6454f2
core/state: fix hooks to account for setcode on non-empty code
holiman Dec 2, 2024
977e409
core/state: fix journal to account for setcode over non-empty code
holiman Dec 2, 2024
3652576
core: more comment
fjl Dec 2, 2024
b27091d
core: lift convenience warming of tx destination from per auth to pos…
lightclient Dec 5, 2024
d4a88d9
core: refactor non-create processing flow
lightclient Dec 5, 2024
858d3b3
internal/ethapi: removed commented out code from test
lightclient Dec 5, 2024
f647d4a
core/vm: direct check code hash during creation instead of resolving
lightclient Dec 6, 2024
85377ab
tests: use big int for stAuthorization because eest needs math.HexOrD…
lightclient Dec 6, 2024
2e0a0a7
core: rm extra whitespace
lightclient Dec 9, 2024
59be843
t8n: do not omit requests when empty
lightclient Dec 10, 2024
621b848
core/vm: return delegation designator prefix for code reading ops
lightclient Dec 10, 2024
f7c3d11
core/vm: report gas used warming 7702 delegation targets correctly in…
lightclient Dec 10, 2024
12f97b7
eth/tracers: add support for setcode tx in prestate tracer
lightclient Dec 10, 2024
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
2 changes: 1 addition & 1 deletion accounts/external/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (api *ExternalSigner) SignTx(account accounts.Account, tx *types.Transactio
switch tx.Type() {
case types.LegacyTxType, types.AccessListTxType:
args.GasPrice = (*hexutil.Big)(tx.GasPrice())
case types.DynamicFeeTxType:
case types.DynamicFeeTxType, types.BlobTxType, types.SetCodeTxType:
args.MaxFeePerGas = (*hexutil.Big)(tx.GasFeeCap())
args.MaxPriorityFeePerGas = (*hexutil.Big)(tx.GasTipCap())
default:
Expand Down
6 changes: 6 additions & 0 deletions cmd/evm/internal/t8ntool/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ type ExecutionResult struct {
WithdrawalsRoot *common.Hash `json:"withdrawalsRoot,omitempty"`
CurrentExcessBlobGas *math.HexOrDecimal64 `json:"currentExcessBlobGas,omitempty"`
CurrentBlobGasUsed *math.HexOrDecimal64 `json:"blobGasUsed,omitempty"`
RequestsHash *common.Hash `json:"requestsHash,omitempty"`
Requests [][]byte `json:"requests"`
}

type executionResultMarshaling struct {
Requests []hexutil.Bytes `json:"requests"`
}

type ommer struct {
Expand Down
134 changes: 134 additions & 0 deletions cmd/evm/internal/t8ntool/gen_execresult.go

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

2 changes: 1 addition & 1 deletion cmd/evm/internal/t8ntool/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func Transaction(ctx *cli.Context) error {
r.Address = sender
}
// Check intrinsic gas
if gas, err := core.IntrinsicGas(tx.Data(), tx.AccessList(), tx.To() == nil,
if gas, err := core.IntrinsicGas(tx.Data(), tx.AccessList(), tx.AuthList(), tx.To() == nil,
chainConfig.IsHomestead(new(big.Int)), chainConfig.IsIstanbul(new(big.Int)), chainConfig.IsShanghai(new(big.Int), 0)); err != nil {
r.Error = err
results = append(results, r)
Expand Down
8 changes: 8 additions & 0 deletions cmd/evm/t8n_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,14 @@ func TestT8n(t *testing.T) {
output: t8nOutput{alloc: true, result: true},
expOut: "exp.json",
},
{ // Prague test, EIP-7702 transaction
base: "./testdata/33",
input: t8nInput{
"alloc.json", "txs.json", "env.json", "Prague", "",
},
output: t8nOutput{alloc: true, result: true},
expOut: "exp.json",
},
} {
args := []string{"t8n"}
args = append(args, tc.output.get()...)
Expand Down
3 changes: 2 additions & 1 deletion cmd/evm/testdata/1/exp.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
}
],
"currentDifficulty": "0x20000",
"gasUsed": "0x5208"
"gasUsed": "0x5208",
"requests": null
}
}
3 changes: 2 additions & 1 deletion cmd/evm/testdata/13/exp2.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
],
"currentDifficulty": "0x20000",
"gasUsed": "0x109a0",
"currentBaseFee": "0x36b"
"currentBaseFee": "0x36b",
"requests": null
}
}
3 changes: 2 additions & 1 deletion cmd/evm/testdata/14/exp.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"currentDifficulty": "0x2000020000000",
"receipts": [],
"gasUsed": "0x0",
"currentBaseFee": "0x500"
"currentBaseFee": "0x500",
"requests": null
}
}
3 changes: 2 additions & 1 deletion cmd/evm/testdata/14/exp2.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"receipts": [],
"currentDifficulty": "0x1ff8020000000",
"gasUsed": "0x0",
"currentBaseFee": "0x500"
"currentBaseFee": "0x500",
"requests": null
}
}
3 changes: 2 additions & 1 deletion cmd/evm/testdata/14/exp_berlin.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"receipts": [],
"currentDifficulty": "0x1ff9000000000",
"gasUsed": "0x0",
"currentBaseFee": "0x500"
"currentBaseFee": "0x500",
"requests": null
}
}
3 changes: 2 additions & 1 deletion cmd/evm/testdata/19/exp_arrowglacier.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"currentDifficulty": "0x2000000200000",
"receipts": [],
"gasUsed": "0x0",
"currentBaseFee": "0x500"
"currentBaseFee": "0x500",
"requests": null
}
}
25 changes: 13 additions & 12 deletions cmd/evm/testdata/19/exp_grayglacier.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"result": {
"stateRoot": "0x6f058887ca01549716789c380ede95aecc510e6d1fdc4dbf67d053c7c07f4bdc",
"txRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"receipts": [],
"currentDifficulty": "0x2000000004000",
"gasUsed": "0x0",
"currentBaseFee": "0x500"
}
}
"result": {
"stateRoot": "0x6f058887ca01549716789c380ede95aecc510e6d1fdc4dbf67d053c7c07f4bdc",
"txRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"receipts": [],
"currentDifficulty": "0x2000000004000",
"gasUsed": "0x0",
"currentBaseFee": "0x500",
"requests": null
}
}
3 changes: 2 additions & 1 deletion cmd/evm/testdata/19/exp_london.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"currentDifficulty": "0x2000080000000",
"receipts": [],
"gasUsed": "0x0",
"currentBaseFee": "0x500"
"currentBaseFee": "0x500",
"requests": null
}
}
3 changes: 2 additions & 1 deletion cmd/evm/testdata/23/exp.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
}
],
"currentDifficulty": "0x20000",
"gasUsed": "0x520b"
"gasUsed": "0x520b",
"requests": null
}
}
3 changes: 2 additions & 1 deletion cmd/evm/testdata/24/exp.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
],
"currentDifficulty": null,
"gasUsed": "0x10306",
"currentBaseFee": "0x500"
"currentBaseFee": "0x500",
"requests": null
}
}
3 changes: 2 additions & 1 deletion cmd/evm/testdata/25/exp.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
],
"currentDifficulty": null,
"gasUsed": "0x5208",
"currentBaseFee": "0x460"
"currentBaseFee": "0x460",
"requests": null
}
}
3 changes: 2 additions & 1 deletion cmd/evm/testdata/26/exp.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"currentDifficulty": null,
"gasUsed": "0x0",
"currentBaseFee": "0x500",
"withdrawalsRoot": "0x4921c0162c359755b2ae714a0978a1dad2eb8edce7ff9b38b9b6fc4cbc547eb5"
"withdrawalsRoot": "0x4921c0162c359755b2ae714a0978a1dad2eb8edce7ff9b38b9b6fc4cbc547eb5",
"requests": null
}
}
3 changes: 2 additions & 1 deletion cmd/evm/testdata/28/exp.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"currentBaseFee": "0x9",
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"currentExcessBlobGas": "0x0",
"blobGasUsed": "0x20000"
"blobGasUsed": "0x20000",
"requests": null
}
}
3 changes: 2 additions & 1 deletion cmd/evm/testdata/29/exp.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"currentBaseFee": "0x9",
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"currentExcessBlobGas": "0x0",
"blobGasUsed": "0x0"
"blobGasUsed": "0x0",
"requests": null
}
}
3 changes: 2 additions & 1 deletion cmd/evm/testdata/3/exp.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
}
],
"currentDifficulty": "0x20000",
"gasUsed": "0x521f"
"gasUsed": "0x521f",
"requests": null
}
}
5 changes: 3 additions & 2 deletions cmd/evm/testdata/30/exp.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"currentBaseFee": "0x7",
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"currentExcessBlobGas": "0x0",
"blobGasUsed": "0x0"
"blobGasUsed": "0x0",
"requests": null
}
}
}
1 change: 1 addition & 0 deletions cmd/evm/testdata/33/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This test sets some EIP-7702 delegations and calls them.
30 changes: 30 additions & 0 deletions cmd/evm/testdata/33/alloc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"0x8a0a19589531694250d570040a0c4b74576919b8": {
"nonce": "0x00",
"balance": "0x0de0b6b3a7640000",
"code": "0x600060006000600060007310000000000000000000000000000000000000015af1600155600060006000600060007310000000000000000000000000000000000000025af16002553d600060003e600051600355",
"storage": {
"0x01": "0x0100",
"0x02": "0x0100",
"0x03": "0x0100"
}
},
"0x000000000000000000000000000000000000aaaa": {
"nonce": "0x00",
"balance": "0x4563918244f40000",
"code": "0x58808080600173703c4b2bd70c169f5717101caee543299fc946c75af100",
"storage": {}
},
"0x000000000000000000000000000000000000bbbb": {
"nonce": "0x00",
"balance": "0x29a2241af62c0000",
"code": "0x6042805500",
"storage": {}
},
"0x71562b71999873DB5b286dF957af199Ec94617F7": {
"nonce": "0x00",
"balance": "0x6124fee993bc0000",
"code": "0x",
"storage": {}
}
}
14 changes: 14 additions & 0 deletions cmd/evm/testdata/33/env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"currentCoinbase": "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentGasLimit": "71794957647893862",
"currentNumber": "1",
"currentTimestamp": "1000",
"currentRandom": "0",
"currentDifficulty": "0",
"blockHashes": {},
"ommers": [],
"currentBaseFee": "7",
"parentUncleHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"withdrawals": [],
"parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
Loading
Loading