-
Notifications
You must be signed in to change notification settings - Fork 73
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: new command for 3D dymint store migration #1302
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1302 +/- ##
==========================================
- Coverage 17.72% 17.29% -0.44%
==========================================
Files 187 195 +8
Lines 55555 58975 +3420
==========================================
+ Hits 9849 10201 +352
- Misses 44182 47183 +3001
- Partials 1524 1591 +67 ☔ View full report in Codecov by Sentry. |
store/storeIface.go
Outdated
@@ -111,4 +111,6 @@ type Store interface { | |||
LoadLastBlockSequencerSet() (types.Sequencers, error) | |||
|
|||
Close() error | |||
|
|||
Run3DMigration(da string) error |
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.
not sure it needs to be in the interface.
migration code can cast to DefaultStore
and call migration code
store/store.go
Outdated
@@ -423,6 +424,79 @@ func (s *DefaultStore) LoadLastBlockSequencerSet() (types.Sequencers, error) { | |||
return sequencers, nil | |||
} | |||
|
|||
func (s *DefaultStore) Run3DMigration(da string) error { |
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.
not sure why it's Store's method
probably should be some migration code in block/
migration cmd has both store and db (store.NewPrefixKV(baseKV, mainPrefix)
)
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.
I've moved it to a standalone func
block/slvalidator.go
Outdated
// skip validation for DRS version 0 (2D rollapps) | ||
if version == 0 { | ||
return nil | ||
} |
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.
gonna merge for now but need some reasoning why this is OK
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.
i think we need to skip drs validation for previous to migration blocks, because in case blocks were received via p2p previous to the migration, when is trying to validate them it will fail to find drs info on store. i replaced this check by only logging error when drs version info is not found (cannot be considered fraud, so i think is fine).
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.
yeah makes sense!
PR Standards
Opening a pull request should be able to meet the following requirements
--
PR naming convention: https://hackmd.io/@nZpxHZ0CT7O5ngTp0TP9mg/HJP_jrm7A
Close #1301
<-- Briefly describe the content of this pull request -->
For Author:
godoc
commentsFor Reviewer:
After reviewer approval: