mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-16 04:56:36 +00:00
core/txpool/blobpool: expose sidecar version in blobTxMeta
needed for filtering logic in block production Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
586ac9b334
commit
440f2d34de
1 changed files with 7 additions and 0 deletions
|
|
@ -92,6 +92,7 @@ const (
|
||||||
type blobTxMeta struct {
|
type blobTxMeta struct {
|
||||||
hash common.Hash // Transaction hash to maintain the lookup table
|
hash common.Hash // Transaction hash to maintain the lookup table
|
||||||
vhashes []common.Hash // Blob versioned hashes to maintain the lookup table
|
vhashes []common.Hash // Blob versioned hashes to maintain the lookup table
|
||||||
|
version byte // Blob transaction version to determine proof type
|
||||||
|
|
||||||
id uint64 // Storage ID in the pool's persistent store
|
id uint64 // Storage ID in the pool's persistent store
|
||||||
storageSize uint32 // Byte size in the pool's persistent store
|
storageSize uint32 // Byte size in the pool's persistent store
|
||||||
|
|
@ -115,10 +116,16 @@ type blobTxMeta struct {
|
||||||
|
|
||||||
// newBlobTxMeta retrieves the indexed metadata fields from a blob transaction
|
// newBlobTxMeta retrieves the indexed metadata fields from a blob transaction
|
||||||
// and assembles a helper struct to track in memory.
|
// and assembles a helper struct to track in memory.
|
||||||
|
// Requires the transaction to have a sidecar (or that we introduce a special version tag for no-sidecar).
|
||||||
func newBlobTxMeta(id uint64, size uint64, storageSize uint32, tx *types.Transaction) *blobTxMeta {
|
func newBlobTxMeta(id uint64, size uint64, storageSize uint32, tx *types.Transaction) *blobTxMeta {
|
||||||
|
if tx.BlobTxSidecar() == nil {
|
||||||
|
// This should never happen, as the pool only admits blob transactions with a sidecar
|
||||||
|
panic("missing blob tx sidecar")
|
||||||
|
}
|
||||||
meta := &blobTxMeta{
|
meta := &blobTxMeta{
|
||||||
hash: tx.Hash(),
|
hash: tx.Hash(),
|
||||||
vhashes: tx.BlobHashes(),
|
vhashes: tx.BlobHashes(),
|
||||||
|
version: tx.BlobTxSidecar().Version,
|
||||||
id: id,
|
id: id,
|
||||||
storageSize: storageSize,
|
storageSize: storageSize,
|
||||||
size: size,
|
size: size,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue