-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feat(en): Fix operator address assignment for ENs #688
feat(en): Fix operator address assignment for ENs #688
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The overall migration strategy is as follows:
- Perform SQL migration changing the DB schema. It should be fast and shouldn't disrupt system operation.
- Perform programmatic data migration (see
fee_address_migration
module). This migration is run in the background in the state keeper / EN pod. It relies that step 1 is complete (i.e., data schema is changed). - (Will be implemented separately) Perform another SQL migration removing obsolete L1 batch columns.
DB queries are rewritten in a way that they will continue to work after the obsolete L1 batch columns are removed. (The natural exception is migration-specific queries, but they should never run at this point.) I.e., code deployed on step 2 should continue working both before and after completing step 3.
core/lib/dal/migrations/20231212121822_add_miniblocks_fee_account_address.up.sql
Show resolved
Hide resolved
core/lib/zksync_core/src/state_keeper/io/fee_address_migration.rs
Outdated
Show resolved
Hide resolved
core/lib/dal/migrations/20231212121822_add_miniblocks_fee_account_address.up.sql
Show resolved
Hide resolved
core/lib/dal/migrations/20231212121822_add_miniblocks_fee_account_address.up.sql
Show resolved
Hide resolved
core/lib/dal/migrations/20231212121822_add_miniblocks_fee_account_address.up.sql
Show resolved
Hide resolved
core/lib/zksync_core/src/state_keeper/io/fee_address_migration.rs
Outdated
Show resolved
Hide resolved
core/lib/zksync_core/src/state_keeper/io/fee_address_migration.rs
Outdated
Show resolved
Hide resolved
core/lib/dal/migrations/20231212121822_add_miniblocks_fee_account_address.up.sql
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Sorry for the long review. Please resolve conflicts and I will reapprove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Surprized it's that involved though. I don't see how exactly we could do it simpler. But it's a good change and we need experience in migrating large tables.
core/lib/dal/migrations/20231212121822_add_miniblocks_fee_account_address.up.sql
Show resolved
Hide resolved
core/lib/dal/migrations/20231212121822_add_miniblocks_fee_account_address.up.sql
Show resolved
Hide resolved
82f15c5
This reverts commit 086ff56.
What ❔
fee_account_address
from thel1_batches
table to theminiblocks
table using a combined SQL and programmatic migration.l1_gas_price
,l2_fair_gas_price
andbase_fee_per_gas
froml1_batches
to the correspondingminiblocks
fields. Removes uses ofl1_batches.is_finished
.L1BatchHeader
/MiniblockHeader
correspondingly.Why ❔
Currently, operator address is not persisted for miniblocks, but only for L1 batches. This has several negative implications:
Checklist
zk fmt
andzk lint
.cargo spellcheck --cfg=./spellcheck/era.cfg --code 1
.