Skip to content

Commit

Permalink
Fix requests getPaylaod
Browse files Browse the repository at this point in the history
  • Loading branch information
somnathb1 committed Nov 20, 2024
1 parent 29b1034 commit 45fd280
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion consensus/merge/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func (s *Merge) Seal(chain consensus.ChainHeaderReader, blockWithReceipts *types
header.Nonce = ProofOfStakeNonce

select {
case results <- &types.BlockWithReceipts{Block: block.WithSeal(header), Receipts: receipts, Requests: requests }:
case results <- &types.BlockWithReceipts{Block: block.WithSeal(header), Receipts: receipts, Requests: requests}:
default:
log.Warn("Sealing result is not read", "sealhash", block.Hash())
}
Expand Down
7 changes: 6 additions & 1 deletion turbo/builder/block_builder.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package builder

import (
"fmt"
"sync"
"sync/atomic"
"time"
Expand Down Expand Up @@ -33,7 +34,11 @@ func NewBlockBuilder(build BlockBuilderFunc, param *core.BlockBuilderParameters)
log.Warn("Failed to build a block", "err", err)
} else {
block := result.Block
log.Info("Built block", "hash", block.Hash(), "height", block.NumberU64(), "txs", len(block.Transactions()), "gas used %", 100*float64(block.GasUsed())/float64(block.GasLimit()), "time", time.Since(t))
reqLenStr := "nil"
if len(result.Requests) == 3 {
reqLenStr = fmt.Sprint("Deposit Requests", len(result.Requests[0].RequestData), "Withdrawal Requests", len(result.Requests[1].RequestData), "Consolidation Requests", len(result.Requests[2].RequestData))
}
log.Info("Built block", "hash", block.Hash(), "height", block.NumberU64(), "txs", len(block.Transactions()), "executionRequests", len(result.Requests), "Requests", reqLenStr, "gas used %", 100*float64(block.GasUsed())/float64(block.GasLimit()), "time", time.Since(t))
}

builder.syncCond.L.Lock()
Expand Down
5 changes: 3 additions & 2 deletions turbo/execution/eth1/block_building.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,11 @@ func (e *EthereumExecutionModule) GetAssembledBlock(ctx context.Context, req *ex
requests := make([][]byte, len(types.KnownRequestTypes))
if len(blockWithReceipts.Requests) == len(types.KnownRequestTypes) {
for i, r := range blockWithReceipts.Requests {
copy(requests[i], r.RequestData)
requests[i] = make([]byte, 0)
requests[i] = append(requests[i], r.RequestData...)
}
} else {
e.logger.Error("Requests len SHOULD BE","equal to", len(types.KnownRequestTypes), "got", len(blockWithReceipts.Requests))
e.logger.Error("Requests len SHOULD BE", "equal to", len(types.KnownRequestTypes), "got", len(blockWithReceipts.Requests))
for i := 0; i < len(types.KnownRequestTypes); i++ {
requests[i] = make([]byte, 0)
}
Expand Down

0 comments on commit 45fd280

Please sign in to comment.