Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmountaintop committed Oct 10, 2024
1 parent 2ca782c commit 2d4a931
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions eth/api_admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

"github.com/scroll-tech/go-ethereum/core"
"github.com/scroll-tech/go-ethereum/core/types"
"github.com/scroll-tech/go-ethereum/log"
"github.com/scroll-tech/go-ethereum/rlp"
)

Expand Down Expand Up @@ -141,3 +142,29 @@ func (api *AdminAPI) ImportChain(file string) (bool, error) {
}
return true, nil
}

// SetRollupEventSyncedL1Height sets the synced L1 height for rollup event synchronization
func (api *AdminAPI) SetRollupEventSyncedL1Height(height uint64) error {
rollupSyncService := api.eth.GetRollupSyncService()
if rollupSyncService == nil {
return errors.New("RollupSyncService is not available")
}

log.Info("Setting rollup event synced L1 height", "height", height)
rollupSyncService.ResetStartSyncHeight(height)

return nil
}

// SetL1MessageSyncedL1Height sets the synced L1 height for L1 message synchronization
func (api *AdminAPI) SetL1MessageSyncedL1Height(height uint64) error {
syncService := api.eth.GetSyncService()
if syncService == nil {
return errors.New("SyncService is not available")
}

log.Info("Setting L1 message synced L1 height", "height", height)
syncService.ResetStartSyncHeight(height)

return nil
}

0 comments on commit 2d4a931

Please sign in to comment.