-
Notifications
You must be signed in to change notification settings - Fork 156
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
Improve witness needed logic #3425
Merged
Merged
Conversation
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
nice clean up! |
47b8dfc
to
cbf3c57
Compare
7db1dee
to
db5eac7
Compare
JaredCorduan
approved these changes
May 15, 2023
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 great, much cleaner and safer!
Certificates structure has changed in Conway, because of that old logic, even with backwards compatibility translation, will not work correctly. In particular, some new certificates did not require a witness, where they should have required one. Abstracting the logic by adding `getVKeyWitnessTxCert` and `getScriptWitnessTxCert` to `EraTxCert` we can solve this problem with different implemnetation on per era basis. This also opens up an opportunitiy for deduplication implemented in a subsequent commit.
It was discusses during a meeting that it was an unfortunate requirement in Shelley to not enforce a witness for staking credential registration. It was implemented to allow ITIN rewards, which is not a feature anymore. Therefore this is no longer a necessary requirement and it was decided to change this by enforcing a wtiness for registration certificates, but only for the ones that contain a deposit. This would mean that we can keep backwards compatibility throughout Conway, but in the next era it will become a proper requirement.
Implementations in Shelley and Alonzo were almost identical.
db5eac7
to
6c4c3c7
Compare
9 tasks
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Abstract deciding which certificates require witnesses.
Certificates structure has changed in Conway, because of that old logic,
even with backwards compatibility translation, will not work correctly.
In particular, some new certificates did not require a witness, where
they should have required one. Abstracting the logic by adding
getVKeyWitnessTxCert
andgetScriptWitnessTxCert
toEraTxCert
wecan solve this problem with different implemnetation on per era basis.
This also opens up an opportunitiy for deduplication implemented in
a subsequent commit.
Make registration certificates with deposits require witnesses
It was discusses during a meeting that it was an unfortunate requirement
in Shelley to not enforce a witness for staking credential registration.
It was implemented to allow ITIN rewards, which is not a feature anymore.
Therefore this is no longer a necessary requirement and it was decided
to change this by enforcing a wtiness for registration certificates, but
only for the ones that contain a deposit. This would mean that we can
keep backwards compatibility throughout Conway, but in the next era it
will become a proper requirement.
Reduce duplication by consolidatiing two versions of witsVKeyNeeded
Implementations in Shelley and Alonzo were almost identical.
Avoid usage of partial functions
In three different places
error
call was removed by improving the logic.Checklist
.cabal
andCHANGELOG.md
files according to theversioning process.
.cabal
files for all affected packages are updated (See RELEASING.md)CHANGELOG.md
for the affected packages. New section is never added with the code changes. (See RELEASING.md)fourmolu
(usescripts/fourmolize.sh
)scripts/cabal-format.sh
)hie.yaml
has been updated (usescripts/gen-hie.sh
)