From 0236be94022db2a571f8e93aa7d3f24cc046b95b Mon Sep 17 00:00:00 2001 From: Francis Li Date: Thu, 27 Mar 2025 16:03:55 -0700 Subject: [PATCH] Adjust based on spec change --- beacon/engine/gen_ed.go | 6 ------ beacon/engine/types.go | 7 ------- core/txpool/blobpool/blobpool.go | 2 +- miner/worker.go | 5 +++++ 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/beacon/engine/gen_ed.go b/beacon/engine/gen_ed.go index e90ad6af81..0ae5a3b8f1 100644 --- a/beacon/engine/gen_ed.go +++ b/beacon/engine/gen_ed.go @@ -35,7 +35,6 @@ func (e ExecutableData) MarshalJSON() ([]byte, error) { BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed"` ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas"` ExecutionWitness *types.ExecutionWitness `json:"executionWitness,omitempty"` - ProofVersion *uint8 `json:"proofVersion"` } var enc ExecutableData enc.ParentHash = e.ParentHash @@ -61,7 +60,6 @@ func (e ExecutableData) MarshalJSON() ([]byte, error) { enc.BlobGasUsed = (*hexutil.Uint64)(e.BlobGasUsed) enc.ExcessBlobGas = (*hexutil.Uint64)(e.ExcessBlobGas) enc.ExecutionWitness = e.ExecutionWitness - enc.ProofVersion = e.ProofVersion return json.Marshal(&enc) } @@ -86,7 +84,6 @@ func (e *ExecutableData) UnmarshalJSON(input []byte) error { BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed"` ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas"` ExecutionWitness *types.ExecutionWitness `json:"executionWitness,omitempty"` - ProofVersion *uint8 `json:"proofVersion"` } var dec ExecutableData if err := json.Unmarshal(input, &dec); err != nil { @@ -163,8 +160,5 @@ func (e *ExecutableData) UnmarshalJSON(input []byte) error { if dec.ExecutionWitness != nil { e.ExecutionWitness = dec.ExecutionWitness } - if dec.ProofVersion != nil { - e.ProofVersion = dec.ProofVersion - } return nil } diff --git a/beacon/engine/types.go b/beacon/engine/types.go index 3984645f3e..f91e18c27b 100644 --- a/beacon/engine/types.go +++ b/beacon/engine/types.go @@ -77,7 +77,6 @@ type ExecutableData struct { BlobGasUsed *uint64 `json:"blobGasUsed"` ExcessBlobGas *uint64 `json:"excessBlobGas"` ExecutionWitness *types.ExecutionWitness `json:"executionWitness,omitempty"` - ProofVersion *uint8 `json:"proofVersion"` } // JSON type overrides for executableData. @@ -307,11 +306,6 @@ func ExecutableDataToBlockNoHash(data ExecutableData, versionedHashes []common.H // BlockToExecutableData constructs the ExecutableData structure by filling the // fields from the given block. It assumes the given block is post-merge block. func BlockToExecutableData(block *types.Block, fees *big.Int, sidecars []*types.BlobTxSidecar, requests [][]byte) *ExecutionPayloadEnvelope { - proofVersion := uint8(0) - // TODO: could be more strict - if len(sidecars) > 0 && len(sidecars[0].Proofs) != len(sidecars[0].Blobs) { - proofVersion = 1 - } data := &ExecutableData{ BlockHash: block.Hash(), ParentHash: block.ParentHash(), @@ -331,7 +325,6 @@ func BlockToExecutableData(block *types.Block, fees *big.Int, sidecars []*types. BlobGasUsed: block.BlobGasUsed(), ExcessBlobGas: block.ExcessBlobGas(), ExecutionWitness: block.ExecutionWitness(), - ProofVersion: &proofVersion, } // Add blobs. diff --git a/core/txpool/blobpool/blobpool.go b/core/txpool/blobpool/blobpool.go index 2dcfa8f868..fbfd6fd5d0 100644 --- a/core/txpool/blobpool/blobpool.go +++ b/core/txpool/blobpool/blobpool.go @@ -107,7 +107,7 @@ type blobTxMeta struct { evictionExecFeeJumps float64 // Worst base fee (converted to fee jumps) across all previous nonces evictionBlobFeeJumps float64 // Worse blob fee (converted to fee jumps) across all previous nonces - proofVersion uint64 // Version of the proof to use for this transaction + proofVersion uint64 // proof version of the transaction, 0 for legacy, 1 for cell proofs } // newBlobTxMeta retrieves the indexed metadata fields from a blob transaction diff --git a/miner/worker.go b/miner/worker.go index 8fb42e31bc..702b5a3923 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -425,6 +425,8 @@ func (miner *Miner) commitTransactions(env *environment, plainTxs, blobTxs *tran // into the given sealing block. The transaction selection and ordering strategy can // be customized with the plugin in the future. func (miner *Miner) fillTransactions(interrupt *atomic.Int32, env *environment) error { + miner.Pending() + miner.confMu.RLock() tip := miner.config.GasPrice prio := miner.prio @@ -444,6 +446,9 @@ func (miner *Miner) fillTransactions(interrupt *atomic.Int32, env *environment) pendingPlainTxs := miner.txpool.Pending(filter) filter.OnlyPlainTxs, filter.OnlyBlobTxs = false, true + if miner.chainConfig.IsOsaka(env.header.Number, env.header.Time) { + filter.OnlyBlobTxWithCellProofs = true + } pendingBlobTxs := miner.txpool.Pending(filter) // Split the pending transactions into locals and remotes.