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
Copy file name to clipboardExpand all lines: arbnode/db-schema/schema.go
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,8 @@ var (
15
15
SequencerBatchMetaPrefix []byte= []byte("s") // maps a batch sequence number to BatchMetadata
16
16
DelayedSequencedPrefix []byte= []byte("a") // maps a delayed message count to the first sequencer batch sequence number with this delayed count
17
17
MelStatePrefix []byte= []byte("l") // maps a parent chain block number to its computed MEL state
18
-
MelDelayedMessagePrefix []byte= []byte("y") // maps a delayed sequence number to an accumulator and an RLP encoded message [TODO: might need to replace or be replaced by RlpDelayedMessagePrefix]
19
-
MelSequencerBatchMetaPrefix []byte= []byte("q") // maps a batch sequence number to BatchMetadata [TODO: might need to replace or be replaced by SequencerBatchMetaPrefix
18
+
MelDelayedMessagePrefix []byte= []byte("y") // maps a delayed sequence number to an accumulator and an RLP encoded message [TODO(NIT-4209): might need to replace or be replaced by RlpDelayedMessagePrefix]
19
+
MelSequencerBatchMetaPrefix []byte= []byte("q") // maps a batch sequence number to BatchMetadata [TODO(NIT-4209): might need to replace or be replaced by SequencerBatchMetaPrefix]
20
20
21
21
MessageCountKey []byte= []byte("_messageCount") // contains the current message count
22
22
LastPrunedMessageKey []byte= []byte("_lastPrunedMessageKey") // contains the last pruned message key
// Add takes values of a DelayedMessageBacklogEntry and adds it to the backlog given the entry succeeds validation. It also attempts trimming of backlog if capacity is reached
46
+
// Add takes values of a DelayedMessageBacklogEntry and adds it to the backlog given the entry succeeds validation. It also attempts trimming of backlog if targetBufferSize is reached
// clear removes from backlog (if exceeds capacity) the entries that correspond to the delayed messages that are both READ and belong to finalized parent chain blocks
90
-
func (d*DelayedMessageBacklog) clear() error {
91
-
iflen(d.entries) <=d.capacity {
92
-
returnnil
93
-
}
82
+
// trimFinalizedAndReadEntries removes from backlog (if exceeds targetBufferSize) the entries that correspond to the delayed messages that are both READ
83
+
// and belong to finalized parent chain blocks. We should not interrupt delayed messages accumulation if we cannot trim the backlog, since its not high priority
returnfmt.Errorf("newDelayedMessagedSeen: %d durign a reorg is greater (by more than 1) than the greatest delayed message index stored in backlog: %d", newDelayedMessagedSeen, d.entries[len(d.entries)-1].Index)
113
+
returnfmt.Errorf("newDelayedMessagedSeen: %d during a reorg is greater (by more than 1) than the greatest delayed message index stored in backlog: %d", newDelayedMessagedSeen, d.entries[len(d.entries)-1].Index)
Copy file name to clipboardExpand all lines: arbnode/mel/runner/backlog.go
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ import (
9
9
10
10
// InitializeDelayedMessageBacklog is to be only called by the Start fsm step of MEL. This function fills the backlog based on the seen and read count from the given mel state
ifstate.DelayedMessagesSeen==0&&state.DelayedMessagesRead==0 { // this is the first mel state so no need to initialize backlog even if the state isnt finalized yet
12
+
ifstate.DelayedMessagesSeen==0&&state.DelayedMessagesRead==0 { // this is the first mel state so no need to initialize backlog even if the state isn't finalized yet
13
13
returnnil
14
14
}
15
15
finalizedDelayedMessagesRead:=state.DelayedMessagesRead// Assume to be finalized, then update if needed
@@ -31,7 +31,7 @@ func InitializeDelayedMessageBacklog(ctx context.Context, d *mel.DelayedMessageB
returnfmt.Errorf("number of mappings from index to ParentChainBlockNum: %d are insufficient, needed atleast: %d", uint64(len(delayedMsgIndexToParentChainBlockNum)), state.DelayedMessagesSeen-targetDelayedMessagesRead)
34
+
returnfmt.Errorf("number of mappings from index to ParentChainBlockNum: %d are insufficient, needed atleast: %d", len(delayedMsgIndexToParentChainBlockNum), state.DelayedMessagesSeen-targetDelayedMessagesRead)
35
35
}
36
36
37
37
// Create DelayedMessageBacklogEntry for all the delayed messages that are seen but not read
// Notice that instead of having seenUnread list from delayed index 13 to 25 inclusive we will have it from 7 to 25 as only till block=7 the chain has finalized and that block has DelayedMessagesRead=7
0 commit comments