bsc/core
Felix Lange 2a6beb6a39
core/types: support for optional blob sidecar in BlobTx (#27841)
This PR removes the newly added txpool.Transaction wrapper type, and instead adds a way
of keeping the blob sidecar within types.Transaction. It's better this way because most
code in go-ethereum does not care about blob transactions, and probably never will. This
will start mattering especially on the client side of RPC, where all APIs are based on
types.Transaction. Users need to be able to use the same signing flows they already
have.

However, since blobs are only allowed in some places but not others, we will now need to
add checks to avoid creating invalid blocks. I'm still trying to figure out the best place
to do some of these. The way I have it currently is as follows:

- In block validation (import), txs are verified not to have a blob sidecar.
- In miner, we strip off the sidecar when committing the transaction into the block.
- In TxPool validation, txs must have a sidecar to be added into the blobpool.
  - Note there is a special case here: when transactions are re-added because of a chain
    reorg, we cannot use the transactions gathered from the old chain blocks as-is,
    because they will be missing their blobs. This was previously handled by storing the
    blobs into the 'blobpool limbo'. The code has now changed to store the full
    transaction in the limbo instead, but it might be confusing for code readers why we're
    not simply adding the types.Transaction we already have.

Code changes summary:

- txpool.Transaction removed and all uses replaced by types.Transaction again
- blobpool now stores types.Transaction instead of defining its own blobTx format for storage
- the blobpool limbo now stores types.Transaction instead of storing only the blobs
- checks to validate the presence/absence of the blob sidecar added in certain critical places
2023-08-14 10:13:34 +02:00
..
asm core/asm: remove unused return value (#27272) 2023-05-16 10:14:04 +02:00
bloombits core/bloombits: use atomic type (#26993) 2023-03-28 03:05:29 -04:00
forkid core: use slices package for sorting (#27489) 2023-06-20 11:58:47 +02:00
rawdb all: update golang/x/ext and fix slice sorting fallout (#27909) 2023-08-12 00:04:12 +02:00
state all: update golang/x/ext and fix slice sorting fallout (#27909) 2023-08-12 00:04:12 +02:00
txpool core/types: support for optional blob sidecar in BlobTx (#27841) 2023-08-14 10:13:34 +02:00
types core/types: support for optional blob sidecar in BlobTx (#27841) 2023-08-14 10:13:34 +02:00
vm core/vm: update 4844 - point evaluation precompile address (#27874) 2023-08-08 15:54:19 +03:00
.gitignore
bench_test.go core/types, params: add blob transaction type, RLP encoded for now (#27049) 2023-04-21 12:52:02 +03:00
block_validator_test.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
block_validator.go core/types: support for optional blob sidecar in BlobTx (#27841) 2023-08-14 10:13:34 +02:00
blockchain_insert.go core: fix log order in "Imported new chain segment" (#25768) 2022-09-15 13:18:23 +02:00
blockchain_reader.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
blockchain_repair_test.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
blockchain_sethead_test.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
blockchain_snapshot_test.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
blockchain_test.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
blockchain.go core/types: support for optional blob sidecar in BlobTx (#27841) 2023-08-14 10:13:34 +02:00
blocks.go core: typos and comments improve 2017-05-25 17:14:33 +03:00
bloom_indexer.go core: preallocate batch size in bloomIndexer (#25289) 2022-08-03 17:02:09 +02:00
chain_indexer_test.go core: fix potential race in chainIndexerTest (#22346) 2021-03-19 13:32:57 +01:00
chain_indexer.go core,console: replace noarg fmt.Errorf with errors.New (#27332) 2023-05-25 08:24:09 -04:00
chain_makers_test.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
chain_makers.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
dao_test.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
error.go all: replace data gas to blob gas in comments (#27825) 2023-08-01 10:07:25 +03:00
events.go eth/filters: remove use of event.TypeMux for pending logs (#20312) 2019-12-10 12:39:14 +01:00
evm.go all: rename dataGas to blobGas (#27789) 2023-07-27 16:53:28 +03:00
forkchoice.go core: clarify code in forkchoice (#26257) 2022-11-28 11:07:25 +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_account.go tests: update for London (#22976) 2021-06-07 14:37:56 +02:00
gen_genesis.go all: rename dataGas to blobGas (#27789) 2023-07-27 16:53:28 +03:00
genesis_alloc.go all: remove the Rinkeby testnet (#27406) 2023-06-02 14:03:21 +03:00
genesis_test.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
genesis.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
headerchain_test.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
headerchain.go all: remove ethash pow, only retain shims needed for consensus and tests (#27178) 2023-05-03 12:58:39 +03:00
mkalloc.go core: use slices package for sorting (#27489) 2023-06-20 11:58:47 +02:00
rlp_test.go all: cleanup tests (#25641) 2022-09-07 20:21:59 +02:00
sender_cacher.go all: refactor txpool into it's own package in prep for 4844 2022-10-24 16:35:53 +03:00
state_prefetcher.go core/types, params: add blob transaction type, RLP encoded for now (#27049) 2023-04-21 12:52:02 +03:00
state_processor_test.go consensus/misc: move eip1559 into a package (#27828) 2023-08-01 12:58:45 +03:00
state_processor.go core, tests: EIP-4844 transaction processing logic (#27721) 2023-07-15 23:27:36 +02:00
state_transition.go all: replace data gas to blob gas in comments (#27825) 2023-08-01 10:07:25 +03:00
types.go core: use atomic type (#27011) 2023-03-30 06:53:32 -04:00