go-ethereum/core
lightclient cdb66c89d6
core/txpool/legacypool: add support for SetCode transactions (#31073)
The new SetCode transaction type introduces some additional complexity
when handling the transaction pool.

This complexity stems from two new account behaviors:

1. The balance and nonce of an account can change during regular
   transaction execution *when they have a deployed delegation*.
2. The nonce and code of an account can change without any EVM execution
   at all. This is the "set code" mechanism introduced by EIP-7702.

The first issue has already been considered extensively during the design
of ERC-4337, and we're relatively confident in the solution of simply
limiting the number of in-flight pending transactions an account can have
to one. This puts a reasonable bound on transaction cancellation. Normally
to cancel, you would need to spend 21,000 gas. Now it's possible to cancel
for around the cost of warming the account and sending value
(`2,600+9,000=11,600`). So 50% cheaper.

The second issue is more novel and needs further consideration.
Since authorizations are not bound to a specific transaction, we
cannot drop transactions with conflicting authorizations. Otherwise,
it might be possible to cherry-pick authorizations from txs and front
run them with different txs at much lower fee amounts, effectively DoSing
the authority. Fortunately, conflicting authorizations do not affect the
underlying validity of the transaction so we can just accept both.

---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-02-11 14:15:04 +01:00
..
asm core/vm, cmd/evm: implement eof validation (#30418) 2024-10-02 15:05:50 +02:00
bloombits all: fix typos in comments (#29873) 2024-05-29 12:24:10 +02:00
forkid params,core/forkid: enable prague on holesky and sepolia (#31139) 2025-02-08 13:26:15 +01:00
rawdb all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
state all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
stateless beacon, core, eth, miner: integrate witnesses into production Geth (#30069) 2024-09-20 16:43:42 +03:00
tracing core/tracing: state journal wrapper (#30441) 2025-02-05 13:58:25 +01:00
txpool core/txpool/legacypool: add support for SetCode transactions (#31073) 2025-02-11 14:15:04 +01:00
types core/txpool/legacypool: add support for SetCode transactions (#31073) 2025-02-11 14:15:04 +01:00
vm all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
.gitignore Renamed `chain` => `core` 2014-12-04 10:28:02 +01:00
bench_test.go all: nuke total difficulty (#30744) 2025-01-28 18:55:41 +01:00
block_validator.go core: switch EVM tx context in ApplyMessage (#30809) 2024-11-29 15:39:42 +01:00
block_validator_test.go all: remove TerminalTotalDifficultyPassed (#30609) 2024-10-23 08:26:18 +02:00
blockchain.go params,core: add max and target value to chain config (#31002) 2025-02-04 15:43:18 +01:00
blockchain_insert.go all: remove forkchoicer and reorgNeeded (#29179) 2024-09-04 15:03:06 +02:00
blockchain_reader.go all: nuke total difficulty (#30744) 2025-01-28 18:55:41 +01:00
blockchain_repair_test.go core, eth, node: break rawdb -> {leveldb, pebble} dependency (#30689) 2024-10-29 10:31:04 +02:00
blockchain_sethead_test.go core, eth, node: break rawdb -> {leveldb, pebble} dependency (#30689) 2024-10-29 10:31:04 +02:00
blockchain_snapshot_test.go core, eth, node: break rawdb -> {leveldb, pebble} dependency (#30689) 2024-10-29 10:31:04 +02:00
blockchain_test.go all: nuke total difficulty (#30744) 2025-01-28 18:55:41 +01:00
bloom_indexer.go core: preallocate batch size in bloomIndexer (#25289) 2022-08-03 17:02:09 +02:00
chain_indexer.go core, eth, ethstats: simplify chain head events (#30601) 2024-10-16 10:32:58 +03:00
chain_indexer_test.go all: improve some error strings (#29842) 2024-05-28 13:44:40 +02:00
chain_makers.go consensus/misc/eip4844: more changes for blob gas calculation (#31128) 2025-02-05 10:35:03 +01:00
chain_makers_test.go params,core: add max and target value to chain config (#31002) 2025-02-04 15:43:18 +01:00
dao_test.go all: remove forkchoicer and reorgNeeded (#29179) 2024-09-04 15:03:06 +02:00
error.go core: implement eip-7623 floor data gas (#30946) 2025-01-30 09:07:45 -07:00
events.go core, eth, ethstats: simplify chain head events (#30601) 2024-10-16 10:32:58 +03:00
evm.go params,core: add max and target value to chain config (#31002) 2025-02-04 15:43:18 +01:00
gaspool.go core, miner: revert block gas counter in case of invalid transaction (#26799) 2023-03-07 05:23:52 -05:00
gen_genesis.go core: go fmt (#29544) 2024-04-16 15:42:16 +03:00
genesis.go core/tracing: state journal wrapper (#30441) 2025-02-05 13:58:25 +01:00
genesis_alloc.go all: clean up goerli flag and config (#30289) 2024-08-20 15:59:48 +02:00
genesis_test.go core: assign default difficulty to zero for chain without ethash (#31067) 2025-02-04 17:16:26 +01:00
headerchain.go all: nuke total difficulty (#30744) 2025-01-28 18:55:41 +01:00
headerchain_test.go all: nuke total difficulty (#30744) 2025-01-28 18:55:41 +01:00
mkalloc.go accounts, cmd/geth, core: close opened files (#29598) 2024-04-30 15:47:21 +02:00
rlp_test.go core: move genesis alloc types to core/types (#29003) 2024-02-16 19:05:33 +01:00
sender_cacher.go core: use sync.Once for SenderCacher initialization (#31029) 2025-01-16 14:36:45 +01:00
state_prefetcher.go core: switch EVM tx context in ApplyMessage (#30809) 2024-11-29 15:39:42 +01:00
state_processor.go core/{.,state,vm},miner,eth/tracers,tests: implement 7709 with a syscall flag (#31036) 2025-01-29 14:31:25 +01:00
state_processor_test.go consensus/misc/eip4844: more changes for blob gas calculation (#31128) 2025-02-05 10:35:03 +01:00
state_transition.go core/tracing: state journal wrapper (#30441) 2025-02-05 13:58:25 +01:00
stateless.go cmd/evm: improve block/state test runner (#30633) 2024-12-02 15:18:02 +01:00
txindexer.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
txindexer_test.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
types.go all: implement flat deposit requests encoding (#30425) 2024-10-09 12:24:58 +02:00
verkle_witness_test.go core/tracing: state journal wrapper (#30441) 2025-02-05 13:58:25 +01:00