@@ -24,7 +24,7 @@ type channel struct {
24
24
channelBuilder * ChannelBuilder
25
25
// Temporary cache for altDACommitments that are received potentially out of order from the da layer.
26
26
// Map: first frameNumber in txData -> txData (that contains an altDACommitment)
27
- // Once the txData containing altDANextFrame is received, it will be pulled out of the
27
+ // Once the txData containing altDAFrameCursor is received, it will be pulled out of the
28
28
// channel on the next driver iteration, and sent to L1.
29
29
altDACommitments map [uint16 ]txData
30
30
// Points to the next frame number to send to L1 in order to maintain holocene strict ordering rules.
@@ -56,6 +56,10 @@ func newChannel(log log.Logger, metr metrics.Metricer, cfg ChannelConfig, rollup
56
56
}
57
57
}
58
58
59
+ // CacheAltDACommitment caches the commitment received from the DA layer for the given txData.
60
+ // We cannot submit it directly to L1 yet, as we need to make sure the commitments are submitted in order,
61
+ // according to the holocene rules. Therefore, we cache the commitment and let the channelManager
62
+ // decide when to pull them out of the channel and send them to L1.
59
63
func (s * channel ) CacheAltDACommitment (txData txData , commitment altda.CommitmentData ) {
60
64
if commitment == nil {
61
65
panic ("expected non-nil commitment" )
@@ -189,7 +193,7 @@ func (c *channel) ID() derive.ChannelID {
189
193
return c .channelBuilder .ID ()
190
194
}
191
195
192
- // NextAltDACommitment checks if it has already receives the altDA commitment
196
+ // NextAltDACommitment checks if it has already received the altDA commitment
193
197
// of the txData whose first frame is altDAFrameCursor. If it has, it returns
194
198
// the txData and true. Otherwise, it returns an empty txData and false.
195
199
func (c * channel ) NextAltDACommitment () (txData , bool ) {
@@ -200,7 +204,7 @@ func (c *channel) NextAltDACommitment() (txData, bool) {
200
204
if len (txData .frames ) == 0 {
201
205
panic ("expected txData to have frames" )
202
206
}
203
- // update altDANextFrame to the first frame of the next txData
207
+ // update altDAFrameCursor to the first frame of the next txData
204
208
lastFrame := txData .frames [len (txData .frames )- 1 ]
205
209
c .altDAFrameCursor = lastFrame .id .frameNumber + 1
206
210
// We also store it in pendingTransactions so that TxFailed can know
0 commit comments