Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: extract stage batches logic into batches processor #1251

Merged
merged 10 commits into from
Oct 7, 2024
4 changes: 4 additions & 0 deletions zk/erigon_db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ func NewErigonDb(tx kv.RwTx) *ErigonDb {
}
}

func (db *ErigonDb) SetNewTx(tx kv.RwTx) {
db.tx = tx
}

func (db ErigonDb) WriteHeader(
blockNo *big.Int,
blockHash common.Hash,
Expand Down
5 changes: 5 additions & 0 deletions zk/hermez_db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ func NewHermezDb(tx kv.RwTx) *HermezDb {
return db
}

func (db *HermezDb) SetNewTx(tx kv.RwTx) {
db.tx = tx
db.HermezDbReader.tx = tx
}

func CreateHermezBuckets(tx kv.RwTx) error {
for _, t := range HermezDbTables {
if err := tx.CreateBucket(t); err != nil {
Expand Down
Loading
Loading