You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -20,143 +20,98 @@ Leverage the existing empty batch mechanism and `dataHashForEmptyTxs` to maintai
20
20
21
21
1.**Modified Batch Retrieval**:
22
22
23
-
The batch retrieval mechanism has been modified to handle empty batches differently. Instead of discarding empty batches, we now return them with the ErrNoBatch error, allowing the caller to create empty blocks with proper timestamps. This ensures that block timing remains consistent even during periods of inactivity.
The batch retrieval mechanism has been modified to handle empty batches differently. Instead of discarding empty batches, we now return them with the ErrNoBatch error, allowing the caller to create empty blocks with proper timestamps. This ensures that block timing remains consistent even during periods of inactivity.
The block publishing logic has been enhanced to create empty blocks when a batch with no transactions is received. This uses the special `dataHashForEmptyTxs` value to indicate an empty batch, maintaining the block height consistency with the DA layer while minimizing overhead.
58
-
59
-
```go
60
-
// In publishBlock method
61
-
batchData, err := m.retrieveBatch(ctx)
62
-
if err != nil {
63
-
if errors.Is(err, ErrNoBatch) {
64
-
if batchData == nil {
65
-
m.logger.Info("No batch retrieved from sequencer, skipping block production")
The block publishing logic has been enhanced to create empty blocks when a batch with no transactions is received. This uses the special `dataHashForEmptyTxs` value to indicate an empty batch, maintaining the block height consistency with the DA layer while minimizing overhead.
58
+
59
+
```go
60
+
// In publishBlock method
61
+
batchData, err:= m.retrieveBatch(ctx)
62
+
if err != nil {
63
+
if errors.Is(err, ErrNoBatch) {
64
+
if batchData == nil {
65
+
m.logger.Info("No batch retrieved from sequencer, skipping block production")
A dedicated lazy aggregation loop has been implemented with dual timer mechanisms. The`lazyTimer` ensures blocks are produced at regular intervals even during network inactivity, while the `blockTimer` handles normal block production when transactions are available. Transaction notifications from the `Reaper` to the `Manager` are now handled via the `txNotifyCh` channel: when the `Reaper` detects new transactions, it calls `Manager.NotifyNewTransactions()`, which performs a non-blocking signal on this channel. See the tests in `block/lazy_aggregation_test.go`for verification of this behavior.
93
-
94
-
```go
95
-
if r.manager != nil && len(newTxs) > 0 {
96
-
r.logger.Debug("Notifying manager of new transactions")
A dedicated lazy aggregation loop has been implemented with dual timer mechanisms. The `lazyTimer` ensures blocks are produced at regular intervals even during network inactivity, while the `blockTimer` handles normal block production when transactions are available. Transaction notifications from the `Reaper` to the `Manager` are now handled via the `txNotifyCh` channel: when the `Reaper` detects new transactions, it calls `Manager.NotifyNewTransactions()`, which performs a non-blocking signal on this channel. See the tests in `block/lazy_aggregation_test.go` for verification of this behavior.
138
93
139
94
4.**Block Production**:
140
95
141
-
The block production function centralizes the logic for publishing blocks and resetting timers. It records the start time, attempts to publish a block, and then intelligently resets both timers based on the elapsed time. This ensures that block production remains on schedule even if the block creation process takes significant time.
The block production function centralizes the logic for publishing blocks and resetting timers. It records the start time, attempts to publish a block, and then intelligently resets both timers based on the elapsed time. This ensures that block production remains on schedule even if the block creation process takes significant time.
0 commit comments