-
Notifications
You must be signed in to change notification settings - Fork 69
New feature 25 "Deterministic Finality and Ride V9" added. #1834
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
Open
alexeykiselev
wants to merge
44
commits into
master
Choose a base branch
from
determenistic-finality-feature
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+13,637
−9,537
Conversation
This file contains hidden or 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
* Added bls signature methods * Added comments * Enforced no duplicates in signatures and public keys * Fixed linter issues * Added pop method * Added public key validation * Bls aggregated sig refactoring (#1838) * BLS package refactoring. Package renamed from blssig to bls. Crypto primitives SecretKey, PublicKey and Signature were added. Public functions Sing and Verify reimplemented to use new primitives. Function to create aggregated signature from multiple Waves secrets keys was removed because it was useful only in tests. PoP functions moved to separate file. * Added test on keys, signature and messages collected from Scala. * Added tests on PoP functions. Fixed review issues. * Fixed linter issues. * Function to create BLS secret key from a Waves secret key moved to bls_test package. Function MustSignatureFromBytes removed. --------- Co-authored-by: Alexey Kiselev <alexey.kiselev@gmail.com>
* Added block finality schemas * Added protobuf schemas * Updated protobuf generated files * Gosec option to exclued generated files added to security workflow. * Set protobuf-schemas submodule to track the branch. Submodule updated to the latest commit. * Generated protobuf code updated to the latest schema. * Protobuf schemas updated and code regenerated. * Tidy go modules. --------- Co-authored-by: Alexey Kiselev <alexey.kiselev@gmail.com>
* Ride version 9 added. New ride function fillList added and tested. * RideV9 functions replaceFirst and replaceAll implemented and tested. * New RideV9 functions for bytes/string conversions with reduced complexity implemented and tested. Old conversion functions refactored to use proper input and output limits. RideV9 functions replaceFirst and replaceAll correct behavior on empty old string implemented. Test naming changed to use fmt.Sprintf to support GoLand interface. * Removed support for 'base16:' prefix for Ride byte conversion functions. Tests modified accordingly. * Added and tested check that Ride V9 scripts is not allowed before activation of DeterministicFinality feature. * Meaningless comment removed. --------- Co-authored-by: Nikolay Eskov <mr.eskov1@yandex.ru>
Proto code regenerated.
* Added bls signature methods * Added comments * Enforced no duplicates in signatures and public keys * Fixed linter issues * Added pop method * Added public key validation * Added block finality schemas * Added protobuf schemas * Updated protobuf generated files * Gosec option to exclued generated files added to security workflow. * Set protobuf-schemas submodule to track the branch. Submodule updated to the latest commit. * Generated protobuf code updated to the latest schema. * WIP: Basic structure of CommitToGeneration transaction implemented. * BLS package refactoring. Package renamed from blssig to bls. Crypto primitives SecretKey, PublicKey and Signature were added. Public functions Sing and Verify reimplemented to use new primitives. Function to create aggregated signature from multiple Waves secrets keys was removed because it was useful only in tests. PoP functions moved to separate file. * Added test on keys, signature and messages collected from Scala. * Added tests on PoP functions. Fixed review issues. * Fixed linter issues. * Protobuf schemas updated and code regenerated. * Tidy go modules. * Some transactions fields renamed according to Protobuf schema. BLS package used to validate PoP during transaction validation. * Protobuf conversion for CommitToGeneration transaction implemented. Test on Protobuf round-trip added. * Introduced constants for Protobuf versions of transactions Reduced cognitive complexity of the new test. * Added test on validation of CommitToGeneration transaction. Added test on JSON serialization of new transaction. WIP: added skipped test on Scala compatibility of JSON serialization. * WIP: Started implementation of commitment transaction conversion into Ride object. Refactored Encode2CBigInt function. * Returned usage of a constant. * WIP: Generation Period length added to functionality settings. BLS keys added to test global variables. Minimal fee amount added for CommitToGeneration transaction. Constants introduced for other fees. Function to calculate next generation period start implemented and tested. Basic checks of CommitToGeneration transaction against state implemented and tested. * WIP: Commitments storage added to state. Basic functions implemented. Commitments serialization implemented and tested. Checks of CommitToGeneration transaction against storage of commitments added to transaction checker. Tests on new checks implemented. New setting MaxGenerators added to networks configurations. StageNet settings updated. * Modernize issues fixed. * Changed the way of calculation of generation period start. Tests updated and added. * Change CommitToGeneration transaction number to 19. * TransactionType stringer fixed. Test on JSON serialization fixed. * Review issues fixed. Unused fields and arguments removed. Data emptiness by length check added. Error messages improved and tests updated. Compile time interface check added. * WIP: Transaction differ for CommitToGeneration transaction implementation started. New snapshot type GenerationCommitmentSnapshot added. Snapshot hashing for new snapshot type implemented. * Functions newestExists and newestSize added to commitments storage. Test on CommitToGeneration transaction performer added. * WIP: CBOR balances serialization implemented. * Balances calculation fixed. Linter issues fixed. * Added conversion of LeaseIn and LeaseOut to int64 with overflow. Warning on such conversions added. * Benchmark on wavesBalanceRecord serialization/deserialization added. * Deprecated functions replaced. * Updated go-safecast package to v2. * Fixed errors check in commitments storage. * Reset Deposits upon generation period end. (#1882) * WIP: Reset Deposits upon generation period end. Functions to calculate generation periods start and end added and modified according to Scala implementation. Tests updated and added. Function to detect generation period end added. Function to reset deposits added. * WIP: Integration test on CommitToGenerationTransaction and deposits resets added. Interagation tests NodeUniversalClient improved. New BlockchainOptions added. BLS keys generation and storing added to itests AccountInfo. BLS Sigrnature JSON deserialization fixed. CommitToGenerationTransaction type added to GuessTransactionType function. MaxGenerators field of FunctionalitySettings renamed to MaxEndorsements. Support for new transaction added to txAppender. Deposit application added to snapshot application of CommitToGeneration transaction. Check on commitments limit for generation period removed. Compliment test removed. Linter fixes. * Excessive logging removed. * Test on deposit rollback added. Test made independent of starting height. * Review issues fixed. Few TODOs resolved. Size functions of commitments storage removed. Safe addition of deposit added. Generation period end function used in state to check if generation period is over. * Key generation options added for BLS secret key generation. (#1910) Options to set custom salt or random salt added. Option to set key info added. Tests on key generation added. * Check on repeated usage of endorser public key from another waves account added. Duplicated code extracted in a function. Test added. * Update legacy state hash (#1901) * WIP: Reset Deposits upon generation period end. Functions to calculate generation periods start and end added and modified according to Scala implementation. Tests updated and added. Function to detect generation period end added. Function to reset deposits added. * WIP: Integration test on CommitToGenerationTransaction and deposits resets added. Interagation tests NodeUniversalClient improved. New BlockchainOptions added. BLS keys generation and storing added to itests AccountInfo. BLS Sigrnature JSON deserialization fixed. CommitToGenerationTransaction type added to GuessTransactionType function. MaxGenerators field of FunctionalitySettings renamed to MaxEndorsements. Support for new transaction added to txAppender. Deposit application added to snapshot application of CommitToGeneration transaction. Check on commitments limit for generation period removed. Compliment test removed. Linter fixes. * Excessive logging removed. * Test on deposit rollback added. Test made independent of starting height. * WIP: Legacy state hash structures moved to separate file. Refactoring of structures in progress. * StateHash structure renamed to StateHashV1. Second version of StateHash with additional field implemented as StateHashV2. Tests on state hash moved to separate file. Total hash generation reimplemented with WriteTo function. Binary serialization of StateHashV1 reimplemented with ReadFrom and WriteTo functions. Wrapper SizedBlockID added to support serialization/deserialization of BlockID prepended with length. * StateHashDebug interface added. Both implementations updated accordingly. Debug API and statehash utility updated to produce and use new interface. BaseTarget reporting added to StateHashDebugV2. * Required getters added to StateHash interface and implementations. HTTP client debug updated to use proto.StateHash interface. Itest HTTP client updated. Utility statecmp updated and refactored a bit. * StateHash version selection upon finality activation implemented. WIP: Broken test added. * Legacy state hash Scala compatibility test implemented. * Linter issue fixed. * Test fixed. * Review issues fixed. UnmarshalBinary added to StateHash interface. Constructors to create appropriate state hashes added. Test added. Save of state hash fixed. * Removed extra fields go mod * Gosec exceptions restored. * Fix settings parameter naming. * Review fixes. Test on CommitToGeneration transaction JSON deserialization updated and skip removed. * One more log fixed. * Restored initial value of defaultTimesapmp in tests. Increased value is used only in tests on CommitToGeneration transaction validations. * StateHashV2 JSON marshalling fixed. Test added. More review fixes. * Fixed errors of converting StateHash to StateHashDebug for both versions. Test added. --------- Co-authored-by: esuwu <sanya554455@gmail.com> Co-authored-by: Nikolay Eskov <mr.eskov1@yandex.ru>
* Added bls signature methods * Added comments * Enforced no duplicates in signatures and public keys * Fixed linter issues * Added pop method * Added public key validation * Added block finality schemas * Added protobuf schemas * Updated protobuf generated files * Gosec option to exclued generated files added to security workflow. * Set protobuf-schemas submodule to track the branch. Submodule updated to the latest commit. * Generated protobuf code updated to the latest schema. * WIP: Basic structure of CommitToGeneration transaction implemented. * BLS package refactoring. Package renamed from blssig to bls. Crypto primitives SecretKey, PublicKey and Signature were added. Public functions Sing and Verify reimplemented to use new primitives. Function to create aggregated signature from multiple Waves secrets keys was removed because it was useful only in tests. PoP functions moved to separate file. * Added test on keys, signature and messages collected from Scala. * Added tests on PoP functions. Fixed review issues. * Fixed linter issues. * Protobuf schemas updated and code regenerated. * Tidy go modules. * Some transactions fields renamed according to Protobuf schema. BLS package used to validate PoP during transaction validation. * Protobuf conversion for CommitToGeneration transaction implemented. Test on Protobuf round-trip added. * Introduced constants for Protobuf versions of transactions Reduced cognitive complexity of the new test. * Added test on validation of CommitToGeneration transaction. Added test on JSON serialization of new transaction. WIP: added skipped test on Scala compatibility of JSON serialization. * WIP: Started implementation of commitment transaction conversion into Ride object. Refactored Encode2CBigInt function. * Returned usage of a constant. * WIP: Generation Period length added to functionality settings. BLS keys added to test global variables. Minimal fee amount added for CommitToGeneration transaction. Constants introduced for other fees. Function to calculate next generation period start implemented and tested. Basic checks of CommitToGeneration transaction against state implemented and tested. * WIP: Commitments storage added to state. Basic functions implemented. Commitments serialization implemented and tested. Checks of CommitToGeneration transaction against storage of commitments added to transaction checker. Tests on new checks implemented. New setting MaxGenerators added to networks configurations. StageNet settings updated. * Modernize issues fixed. * Changed the way of calculation of generation period start. Tests updated and added. * Change CommitToGeneration transaction number to 19. * TransactionType stringer fixed. Test on JSON serialization fixed. * Review issues fixed. Unused fields and arguments removed. Data emptiness by length check added. Error messages improved and tests updated. Compile time interface check added. * WIP: Transaction differ for CommitToGeneration transaction implementation started. New snapshot type GenerationCommitmentSnapshot added. Snapshot hashing for new snapshot type implemented. * Functions newestExists and newestSize added to commitments storage. Test on CommitToGeneration transaction performer added. * WIP: CBOR balances serialization implemented. * Balances calculation fixed. Linter issues fixed. * Added conversion of LeaseIn and LeaseOut to int64 with overflow. Warning on such conversions added. * Benchmark on wavesBalanceRecord serialization/deserialization added. * Deprecated functions replaced. * Updated go-safecast package to v2. * Fixed errors check in commitments storage. * Reset Deposits upon generation period end. (#1882) * WIP: Reset Deposits upon generation period end. Functions to calculate generation periods start and end added and modified according to Scala implementation. Tests updated and added. Function to detect generation period end added. Function to reset deposits added. * WIP: Integration test on CommitToGenerationTransaction and deposits resets added. Interagation tests NodeUniversalClient improved. New BlockchainOptions added. BLS keys generation and storing added to itests AccountInfo. BLS Sigrnature JSON deserialization fixed. CommitToGenerationTransaction type added to GuessTransactionType function. MaxGenerators field of FunctionalitySettings renamed to MaxEndorsements. Support for new transaction added to txAppender. Deposit application added to snapshot application of CommitToGeneration transaction. Check on commitments limit for generation period removed. Compliment test removed. Linter fixes. * Excessive logging removed. * Test on deposit rollback added. Test made independent of starting height. * Review issues fixed. Few TODOs resolved. Size functions of commitments storage removed. Safe addition of deposit added. Generation period end function used in state to check if generation period is over. * Key generation options added for BLS secret key generation. (#1910) Options to set custom salt or random salt added. Option to set key info added. Tests on key generation added. * Check on repeated usage of endorser public key from another waves account added. Duplicated code extracted in a function. Test added. * Update legacy state hash (#1901) * WIP: Reset Deposits upon generation period end. Functions to calculate generation periods start and end added and modified according to Scala implementation. Tests updated and added. Function to detect generation period end added. Function to reset deposits added. * WIP: Integration test on CommitToGenerationTransaction and deposits resets added. Interagation tests NodeUniversalClient improved. New BlockchainOptions added. BLS keys generation and storing added to itests AccountInfo. BLS Sigrnature JSON deserialization fixed. CommitToGenerationTransaction type added to GuessTransactionType function. MaxGenerators field of FunctionalitySettings renamed to MaxEndorsements. Support for new transaction added to txAppender. Deposit application added to snapshot application of CommitToGeneration transaction. Check on commitments limit for generation period removed. Compliment test removed. Linter fixes. * Excessive logging removed. * Test on deposit rollback added. Test made independent of starting height. * WIP: Legacy state hash structures moved to separate file. Refactoring of structures in progress. * StateHash structure renamed to StateHashV1. Second version of StateHash with additional field implemented as StateHashV2. Tests on state hash moved to separate file. Total hash generation reimplemented with WriteTo function. Binary serialization of StateHashV1 reimplemented with ReadFrom and WriteTo functions. Wrapper SizedBlockID added to support serialization/deserialization of BlockID prepended with length. * StateHashDebug interface added. Both implementations updated accordingly. Debug API and statehash utility updated to produce and use new interface. BaseTarget reporting added to StateHashDebugV2. * Required getters added to StateHash interface and implementations. HTTP client debug updated to use proto.StateHash interface. Itest HTTP client updated. Utility statecmp updated and refactored a bit. * StateHash version selection upon finality activation implemented. WIP: Broken test added. * Legacy state hash Scala compatibility test implemented. * Linter issue fixed. * Test fixed. * Review issues fixed. UnmarshalBinary added to StateHash interface. Constructors to create appropriate state hashes added. Test added. Save of state hash fixed. * Removed extra fields go mod * Gosec exceptions restored. * Generation balance check added to CommitToGeneration transaction validation. Tests updated. Test on insufficient generation balance added. Function to get minimal generation balance moved to state package. Consensus package refactored. Linter fixes. * Fix settings parameter naming. * Included deposit and fee amounts in generation balance validation. Tests updated. * Review fixes. Test on CommitToGeneration transaction JSON deserialization updated and skip removed. * One more log fixed. * Restored initial value of defaultTimesapmp in tests. Increased value is used only in tests on CommitToGeneration transaction validations. * StateHashV2 JSON marshalling fixed. Test added. More review fixes. * Fixed errors of converting StateHash to StateHashDebug for both versions. Test added. * Function renamed. --------- Co-authored-by: esuwu <sanya554455@gmail.com> Co-authored-by: Nikolay Eskov <mr.eskov1@yandex.ru>
* Fixed two errors found by Semgrep. Protobuf generated files *.pb.go added to semgrep exclude file. * Improve .semgrepignore file.
* Add 'GenerationCommitment' atomic snapsot unmarshaling to 'TxSnapshotsFromProtobufWithoutTxStatus'. * Add tests.
* Ride description of new transaction added. Code regenerated. * Fixed JSON formatting. Added code-generation README file. * Generated Ride objects marked for betteralign check. Generated structures aligned. * Implemented 'commitToGenerationToObject' function. * Add 'ConstantsV9' to the ride generator tool * Support 'RideV9' in selector functions. * Add 'TestRideCommitToGenerationTransactionConstruction'. * Fixed issues made by @copilot. --------- Co-authored-by: Nikolay Eskov <mr.eskov1@yandex.ru>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
awaiting-release
Ready to be a part of a new release
do not merge
The PR is not ready to be merged
wip
This is a WIP, should not be merged right away
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.
No description provided.