File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -120,8 +120,10 @@ impl Step<Flashblocks> for PublishFlashblock {
120120 . expect ( "withdrawals_root is present" ) ,
121121 } ;
122122
123+ // Get 0-index to use in flashblock
124+ let index = self . flashblock_number . index ( ) ;
123125 // Increment flashblock number since we've built the flashblock
124- let index = self . flashblock_number . advance ( ) ;
126+ self . flashblock_number . advance ( ) ;
125127
126128 // Push the contents of the payload
127129 if let Err ( e) = self . sink . publish ( & FlashblocksPayloadV1 {
Original file line number Diff line number Diff line change @@ -27,6 +27,14 @@ impl FlashblockNumber {
2727 self . target_flashblocks . load ( Ordering :: Relaxed )
2828 }
2929
30+ /// Returns current flashblock in 0-index format
31+ pub fn index ( & self ) -> u64 {
32+ self
33+ . current_flashblock
34+ . load ( Ordering :: Relaxed )
35+ . saturating_sub ( 1 )
36+ }
37+
3038 pub fn advance ( & self ) -> u64 {
3139 self . current_flashblock . fetch_add ( 1 , Ordering :: Relaxed )
3240 }
You can’t perform that action at this time.
0 commit comments