chore(consensus): change SetHeadL1Origin && UpdateL1Origin to taikoauth_ namespace (#386)

* move the update api to taiko auth namespace

* fix lint
This commit is contained in:
maskpp 2025-02-18 10:44:40 +08:00 committed by GitHub
parent a3e2b34b48
commit 838f653153
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -60,18 +60,6 @@ func (s *TaikoAPIBackend) L1OriginByID(blockID *math.HexOrDecimal256) (*rawdb.L1
return l1Origin, nil
}
// SetHeadL1Origin sets the latest L2 block's corresponding L1 origin.
func (s *TaikoAPIBackend) SetHeadL1Origin(blockID *math.HexOrDecimal256) *big.Int {
rawdb.WriteHeadL1Origin(s.eth.ChainDb(), (*big.Int)(blockID))
return (*big.Int)(blockID)
}
// UpdateL1Origin updates the L2 block's corresponding L1 origin.
func (s *TaikoAPIBackend) UpdateL1Origin(l1Origin *rawdb.L1Origin) *rawdb.L1Origin {
rawdb.WriteL1Origin(s.eth.ChainDb(), l1Origin.BlockID, l1Origin)
return l1Origin
}
// GetSyncMode returns the node sync mode.
func (s *TaikoAPIBackend) GetSyncMode() (string, error) {
return s.eth.config.SyncMode.String(), nil
@ -87,6 +75,18 @@ func NewTaikoAuthAPIBackend(eth *Ethereum) *TaikoAuthAPIBackend {
return &TaikoAuthAPIBackend{eth}
}
// SetHeadL1Origin sets the latest L2 block's corresponding L1 origin.
func (a *TaikoAuthAPIBackend) SetHeadL1Origin(blockID *math.HexOrDecimal256) *big.Int {
rawdb.WriteHeadL1Origin(a.eth.ChainDb(), (*big.Int)(blockID))
return (*big.Int)(blockID)
}
// UpdateL1Origin updates the L2 block's corresponding L1 origin.
func (a *TaikoAuthAPIBackend) UpdateL1Origin(l1Origin *rawdb.L1Origin) *rawdb.L1Origin {
rawdb.WriteL1Origin(a.eth.ChainDb(), l1Origin.BlockID, l1Origin)
return l1Origin
}
// TxPoolContent retrieves the transaction pool content with the given upper limits.
func (a *TaikoAuthAPIBackend) TxPoolContent(
beneficiary common.Address,