-
Notifications
You must be signed in to change notification settings - Fork 116
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
Fix: export InitTimeoutTimestamps and VscSendTimestamps to genesis #1076
Merged
Merged
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
142efee
fix: add InitTimeoutTimestamps and VscSendTimestamps to genesis
27a50f2
merge main
9fc44d5
fix: add chainID to vscSendTimestamp
7099903
test: fix tests
6d94704
test: fixgenesis test
b845cbb
test: fix test TestInitAndExportGenesis
cb6588b
feat: add exportedVscSendTimestamps
ad6bf75
docs: update changelog
9f80b08
feat: update exportedVscSendTimestamps
0344988
fix: lint
36a8a6b
Merge branch 'main' into fix-export
yaruwangway File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
a new field ChainId is added, so that when exporting VscSendTimestamp to genesis, the chainID info is carried.
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.
Changing the order of fields inside a proto message is state breaking since this proto is used for storing state.
If you are adding a
chain_id
it should be done by adding it to the end (so it becomesstring chain_id = 3
).I would advise against changing that structure, and instead change
GenesisState
of the provider like this:That way we don't introduce state breaking changes, but have in mind that you would need to change the provider's Export genesis too
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.
Hi, this way, we lost the chainID info for
VscSendTimestamps
?how about create a new struct to wrap the original
VscSendTimestamps
with chainID for the genesis exporting.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, unless it's necessary, try not to change the original structures as it will require state migration.
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.
We don't lose it, it's stored as part of the key in the state.
You can have a structure like this when exporting/importing:
Where
ExportedVscSendTimestamps
looks like: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.
adding chainID to
VscSendTimestamp
is api breaking ?anway, can you review this PR ? Thank you!
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.
If possible, let's not reimplement this.
I'm suggesting to keep the changes already made. The benefit of the refactor is minimal.
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.
If API breaking means that the genesis JSON schema would change, then yes. That's not a problem tho
Re @MSalopek's comment, imo for tech debt reasons we should avoid adding shims/wrapper types unless they're absolutely needed to avoid a state migration. In this case there is no state migration to avoid.
I'll approve as to not slow everyone down, but since this is a
good first issue
, I just wanna make sure we understand the mechanics behind things being state breakingThere 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.
im just not sure about the impact of the api breaking change, so please let me know, i could change this PR if adding chainID to
VscSendTimestamp
is better.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.
People use "API breaking" in different ways, so I can't comment on impact of an api breaking change. But I can say it's ok to change the JSON schema for import/export genesis, and I believe any solution #612 would require we change that JSON schema
@MSalopek @mpoke lmk if I'm incorrect here
Re best solution for the PR, I'll leave that up to the other approver, as this thread has gotten long