@@ -24,7 +24,7 @@ type channel struct {
2424 channelBuilder * ChannelBuilder
2525 // Temporary cache for altDACommitments that are received potentially out of order from the da layer.
2626 // 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
2828 // channel on the next driver iteration, and sent to L1.
2929 altDACommitments map [uint16 ]txData
3030 // 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
5656 }
5757}
5858
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.
5963func (s * channel ) CacheAltDACommitment (txData txData , commitment altda.CommitmentData ) {
6064 if commitment == nil {
6165 panic ("expected non-nil commitment" )
@@ -189,7 +193,7 @@ func (c *channel) ID() derive.ChannelID {
189193 return c .channelBuilder .ID ()
190194}
191195
192- // NextAltDACommitment checks if it has already receives the altDA commitment
196+ // NextAltDACommitment checks if it has already received the altDA commitment
193197// of the txData whose first frame is altDAFrameCursor. If it has, it returns
194198// the txData and true. Otherwise, it returns an empty txData and false.
195199func (c * channel ) NextAltDACommitment () (txData , bool ) {
@@ -200,7 +204,7 @@ func (c *channel) NextAltDACommitment() (txData, bool) {
200204 if len (txData .frames ) == 0 {
201205 panic ("expected txData to have frames" )
202206 }
203- // update altDANextFrame to the first frame of the next txData
207+ // update altDAFrameCursor to the first frame of the next txData
204208 lastFrame := txData .frames [len (txData .frames )- 1 ]
205209 c .altDAFrameCursor = lastFrame .id .frameNumber + 1
206210 // We also store it in pendingTransactions so that TxFailed can know
0 commit comments