merge fixes

pull/4510/head
Diego Nava 1 year ago
parent 51ed6b6b40
commit 68cb005dc3
No known key found for this signature in database
GPG Key ID: 61AFC8738DA8B8B1
  1. 13
      core/state_processor.go
  2. 3
      node/node_newblock.go

@ -57,9 +57,10 @@ const (
//
// StateProcessor implements Processor.
type StateProcessor struct {
bc BlockChain // Canonical blockchain
beacon BlockChain // Beacon chain
resultCache *lru.Cache // Cache for result after a certain block is processed
config *params.ChainConfig // Chain configuration options
bc BlockChain // Canonical blockchain
beacon BlockChain // Beacon chain
resultCache *lru.Cache // Cache for result after a certain block is processed
}
// this structure is cached, and each individual element is returned
@ -152,14 +153,14 @@ func (p *StateProcessor) Process(
processTxsAndStxs = false
}
}
if processTxsAndStxs {
startTime := time.Now()
// Iterate over and process the individual transactions
for i, tx := range block.Transactions() {
statedb.Prepare(tx.Hash(), block.Hash(), i)
receipt, cxReceipt, stakeMsgs, _, err := ApplyTransaction(
p.config, p.bc, &beneficiary, gp, statedb, header, tx, usedGas, cfg,
p.bc, &beneficiary, gp, statedb, header, tx, usedGas, cfg,
)
if err != nil {
return nil, nil, nil, nil, 0, nil, statedb, err
@ -181,7 +182,7 @@ func (p *StateProcessor) Process(
for i, tx := range block.StakingTransactions() {
statedb.Prepare(tx.Hash(), block.Hash(), i+L)
receipt, _, err := ApplyStakingTransaction(
p.config, p.bc, &beneficiary, gp, statedb, header, tx, usedGas, cfg,
p.bc, &beneficiary, gp, statedb, header, tx, usedGas, cfg,
)
if err != nil {
return nil, nil, nil, nil, 0, nil, statedb, err

@ -295,10 +295,9 @@ func (node *Node) ProposeNewBlock(commitSigs chan []byte) (*types.Block, error)
}
utils.Logger().Info().Msg("[ProposeNewBlock] verifying the new block header")
// err = node.Blockchain().Validator().ValidateHeader(finalizedBlock, true)
// err = node.Blockchain().Validator().ValidateHeader(finalizedBlock, true)
err = core.NewBlockValidator(node.Blockchain()).ValidateHeader(finalizedBlock, true)
if err != nil {
utils.Logger().Error().Err(err).Msg("[ProposeNewBlock] Failed verifying the new block header")
return nil, err

Loading…
Cancel
Save