diff --git a/consensus/parlia/parlia.go b/consensus/parlia/parlia.go index f498e380362..412fdd067ed 100644 --- a/consensus/parlia/parlia.go +++ b/consensus/parlia/parlia.go @@ -1023,10 +1023,12 @@ func (p *Parlia) finalize(header *types.Header, ibs *state.IntraBlockState, txs } } } - finish, err = p.distributeToSystem(header.Coinbase, ibs, header, &txs, &receipts, &systemTxs, &header.GasUsed, mining, systemTxCall, &curIndex, &txIndex) - if err != nil || finish { - //log.Error("distributeIncoming", "block hash", header.Hash(), "error", err, "systemTxs", len(systemTxs)) - return nil, nil, nil, err + if !p.chainConfig.IsKepler(header.Number.Uint64(), header.Time) { + finish, err = p.distributeToSystem(header.Coinbase, ibs, header, &txs, &receipts, &systemTxs, &header.GasUsed, mining, systemTxCall, &curIndex, &txIndex) + if err != nil || finish { + //log.Error("distributeIncoming", "block hash", header.Hash(), "error", err, "systemTxs", len(systemTxs)) + return nil, nil, nil, err + } } finish, err = p.distributeToValidator(header.Coinbase, ibs, header, &txs, &receipts, &systemTxs, &header.GasUsed, mining, systemTxCall, &curIndex, &txIndex) @@ -1381,7 +1383,7 @@ func (p *Parlia) initContract(state *state.IntraBlockState, header *types.Header return false, err } for _, c := range contracts { - p.logger.Info("Init contracts", "len(systemTxs)", len(*systemTxs), "len(txs)", len(*txs)) + // p.logger.Info("Init contracts", "len(systemTxs)", len(*systemTxs), "len(txs)", len(*txs)) if *curIndex == *txIndex { return p.applyTransaction(header.Coinbase, c, u256.Num0, data, state, header, txs, receipts, systemTxs, usedGas, mining, systemTxCall, curIndex) } @@ -1398,8 +1400,7 @@ func (p *Parlia) distributeToSystem(val libcommon.Address, ibs *state.IntraBlock if balance.Cmp(u256.Num0) <= 0 { return false, nil } - doDistributeSysReward := !p.chainConfig.IsKepler(header.Number.Uint64(), header.Time) && - ibs.GetBalance(systemcontracts.SystemRewardContract).Cmp(maxSystemBalance) < 0 + doDistributeSysReward := ibs.GetBalance(systemcontracts.SystemRewardContract).Cmp(maxSystemBalance) < 0 if doDistributeSysReward { rewards := new(uint256.Int) rewards = rewards.Rsh(balance, systemRewardPercent) @@ -1411,9 +1412,9 @@ func (p *Parlia) distributeToSystem(val libcommon.Address, ibs *state.IntraBlock txs, receipts, systemTxs, usedGas, mining, systemTxCall, curIndex) } } - return false, nil + } else if *(*txs)[*curIndex].GetTo() == systemcontracts.SystemRewardContract { + *curIndex++ } - *curIndex++ return false, nil } diff --git a/turbo/snapshotsync/freezeblocks/block_reader.go b/turbo/snapshotsync/freezeblocks/block_reader.go index 30f38fd9701..565bea6a816 100644 --- a/turbo/snapshotsync/freezeblocks/block_reader.go +++ b/turbo/snapshotsync/freezeblocks/block_reader.go @@ -1976,7 +1976,7 @@ func (r *BlockReader) ReadBlobByNumber(ctx context.Context, tx kv.Getter, blockH } return r.bs.ReadBlobSidecars(ctx, blockHeight, blockHash) } - log.Info("Read BlobSidecar from snapshots") + //log.Info("Read BlobSidecar from snapshots") blobs, err := r.bscSn.ReadBlobSidecars(blockHeight) if err != nil { return nil, false, err