Update for Deneb/Cancun fork (#23)
Updates Plugeth to version corresponding to Geth 1.13.14. - Deneb/Cancun updates - Updates to state/trie related interfaces Reviewed-on: #23 Reviewed-by: jonathanface <jonathanface@noreply.git.vdb.to> Reviewed-by: Thomas E Lackey <telackey@noreply.git.vdb.to>
This commit was merged in pull request #23.
This commit is contained in:
@@ -26,6 +26,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/consensus/misc/eip4844"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/metrics"
|
||||
@@ -90,11 +91,16 @@ func (sdi *StateDiffIndexer) PushBlock(block *types.Block, receipts types.Receip
|
||||
t := time.Now()
|
||||
blockHash := block.Hash()
|
||||
height := block.NumberU64()
|
||||
|
||||
var blobGasPrice *big.Int
|
||||
excessBlobGas := block.ExcessBlobGas()
|
||||
if excessBlobGas != nil {
|
||||
blobGasPrice = eip4844.CalcBlobFee(*excessBlobGas)
|
||||
}
|
||||
transactions := block.Transactions()
|
||||
var err error
|
||||
|
||||
// Derive any missing fields
|
||||
if err := receipts.DeriveFields(sdi.chainConfig, blockHash, height, block.BaseFee(), transactions); err != nil {
|
||||
if err := receipts.DeriveFields(sdi.chainConfig, blockHash, height, block.Time(), block.BaseFee(), blobGasPrice, transactions); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -146,6 +152,7 @@ func (sdi *StateDiffIndexer) PushBlock(block *types.Block, receipts types.Receip
|
||||
err = sdi.processReceiptsAndTxs(batch, processArgs{
|
||||
headerID: headerID,
|
||||
blockNumber: block.Number(),
|
||||
blockTime: block.Time(),
|
||||
receipts: receipts,
|
||||
txs: transactions,
|
||||
rctNodes: rctNodes,
|
||||
@@ -248,6 +255,7 @@ func (sdi *StateDiffIndexer) processUncles(tx *BatchTx, headerID string, blockNu
|
||||
type processArgs struct {
|
||||
headerID string
|
||||
blockNumber *big.Int
|
||||
blockTime uint64
|
||||
receipts types.Receipts
|
||||
txs types.Transactions
|
||||
rctNodes []*ipld.EthReceipt
|
||||
@@ -258,7 +266,7 @@ type processArgs struct {
|
||||
// processReceiptsAndTxs publishes and indexes receipt and transaction IPLDs in Postgres
|
||||
func (sdi *StateDiffIndexer) processReceiptsAndTxs(tx *BatchTx, args processArgs) error {
|
||||
// Process receipts and txs
|
||||
signer := types.MakeSigner(sdi.chainConfig, args.blockNumber)
|
||||
signer := types.MakeSigner(sdi.chainConfig, args.blockNumber, args.blockTime)
|
||||
for i, receipt := range args.receipts {
|
||||
txNode := args.txNodes[i]
|
||||
tx.cacheIPLD(txNode)
|
||||
|
||||
Reference in New Issue
Block a user