Skip to content

Commit

Permalink
moved hotfix apis from ScrollAPI to PrivateAdminAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
colinlyguo committed Sep 19, 2024
1 parent d38f656 commit e39cdb1
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions eth/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,34 @@ func (api *PrivateAdminAPI) ImportChain(file string) (bool, error) {
return true, nil
}

// SetRollupEventSyncedL1Height sets the synced L1 height for rollup event synchronization
func (api *PrivateAdminAPI) 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.ResetToHeight(height)

return nil
}

// SetL1MessageSyncedL1Height sets the synced L1 height for L1 message synchronization
func (api *PrivateAdminAPI) 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.ResetToHeight(height)

return nil
}

// PublicDebugAPI is the collection of Ethereum full node APIs exposed
// over the public debugging endpoint.
type PublicDebugAPI struct {
Expand Down Expand Up @@ -833,31 +861,3 @@ func (api *ScrollAPI) CalculateRowConsumptionByBlockNumber(ctx context.Context,
asyncChecker.Wait()
return rawdb.ReadBlockRowConsumption(api.eth.ChainDb(), block.Hash()), checkErr
}

// SetRollupEventSyncedL1Height sets the synced L1 height for rollup event synchronization
func (api *ScrollAPI) 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.ResetToHeight(height)

return nil
}

// SetL1MessageSyncedL1Height sets the synced L1 height for L1 message synchronization
func (api *ScrollAPI) 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.ResetToHeight(height)

return nil
}

0 comments on commit e39cdb1

Please sign in to comment.