go-ethereum/rollup/da_syncer/da/finalize.go
Jonas Theis ac8164f5a4
feat: follower node sync from DA (#1098)
* port changes from #1013

* port changes from #1068

* go.mod tidy

* fix compile error

* fix goimports

* fix log

* address review comments

* upgrade golang.org/x/net to 0.23.0

* bump version

* remove unused flag

* update da-codec commit

---------

Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
2024-12-18 17:27:51 +01:00

34 lines
594 B
Go

package da
type FinalizeBatch struct {
batchIndex uint64
l1BlockNumber uint64
}
func NewFinalizeBatch(batchIndex uint64) *FinalizeBatch {
return &FinalizeBatch{
batchIndex: batchIndex,
}
}
func (f *FinalizeBatch) Type() Type {
return FinalizeBatchType
}
func (f *FinalizeBatch) L1BlockNumber() uint64 {
return f.l1BlockNumber
}
func (f *FinalizeBatch) BatchIndex() uint64 {
return f.batchIndex
}
func (f *FinalizeBatch) CompareTo(other Entry) int {
if f.BatchIndex() < other.BatchIndex() {
return -1
} else if f.BatchIndex() > other.BatchIndex() {
return 1
}
return 0
}