Skip to content

Conversation

@vladimirlogachev
Copy link
Contributor

No description provided.

@vladimirlogachev vladimirlogachev marked this pull request as ready for review November 25, 2025 18:37
newFinalizedHeight,
updatedCurrentGeneratorBalances,
nextCommittedGenerators,
if deterministicFinalityActivated then Some(nextCommittedGenerators) else None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need Option here, because deterministicFinalityActivated only if this.generationPeriodOf(h) non empty. See the next comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, fixed

@vsuharnikov vsuharnikov merged commit d48fb02 into deterministic-finality-feature Nov 26, 2025
3 of 4 checks passed
@vsuharnikov vsuharnikov deleted the fix-statehash-api branch November 26, 2025 16:56
phearnot added a commit that referenced this pull request Dec 18, 2025
* Add DeterministicFinality blockchain feature

* Apply the fix for SeveralAccountMiningSuite

* wip

* Refactoring and unit test

* Fixed compilation errors

* EndorseBlockSynchronizer and tests

* EndorseBlockSynchronizer in Application

* Fixed formatting

* EndorseBlock.finalizedId

* CommitToGenerationTransaction

* CommitToGenerationTransaction - 2

* CommitToGenerationTransaction updates (new protobuf), CommiteToGenerationRequest, tests

* - Fixed the minimal fee;
- blst dependency;
- A test with activation;
- Cleanup.

* Signing CommitToGeneration with BLS

* API: Get BLS public key by address

* Returned generation start height for CommitToGenerationTransaction, providing this height during signing is optional

* Store generators balances - WIP

* Unit tests fixes WIP

* Unit tests fixes WIP (2)

* Fix compilation issues in node-it

* Fix formatting issues in node

* Fixing tests

* Fixed compilation issues in the benchmark module

* Fixed StateHashSpec

* Fixing tests

* Fixed bug and BlockChangeTest

* Fixed ProtoVersionTransactionsSpec

* Append and rollback generator balances

* Append next committed generators

* Fixed formatting

* Rollback committed generators

* GenerationPeriod class, cleanup

* Fixed compilation issues

* Cleanup

* Disabled "Try it out" for Swagger

* Store multiple committedGenerators in DB on height

* Store multiple generator balances in DB on height

* blockchainUpdater.generationPeriodOf

* Committed generators is a seq to preserve the order

* WIP
- GeneratorsApiRoute and CommonGeneratorsApi
- Loading committed generators;
- BlockEndorsement uses BLS (was a mock impl with curve keys)
- Changed storing related data in DB

* - CommonGeneratorsApi - works with recent generator balances too;
- Fixed tests.

* Ignore challenging in generators' balances

* Removed unused parameter

* Checking enough generator balances

* Removed unused imports

* Fixed CommitToGenerationTransactionsSpec

* Generators balances unchanged even challenging

* Fixing linter warnings

* CommitToGenerationTransaction: deposit instead of fee

* /blocks/headers/finalized

* - Finalization WIP
- BlsSignature class

* Generator balances cache

* BlockAppenderSpec:
* Test for generators balances;
* Catching not applied block;
* Compact code.

* Fixed formatting issues

* WIP: EndorsementStorage, finalizationVoting in block

* WIP: aggregated BLS

* BLS update wip

* fix: compilation issues

* Updated the way we store generators' balances

* Removed unnecessary code

* WIP

* Fixes

* Fixed some tests

* Update for finalized height key

* Fixed tests

* Fixed tests (2)

* Fixed tests (3)

* Fixing finality WIP

* Handle bigger endorsement messages, better errors and naming

* Fixed warnings

* DebugApiRoute test for /rollback: finalized height is moving during long rollbacks

* Fixed compilation issues

* A miner doesn’t need to endorse its own blocks - mining is already an endorsement

* Balance snapshots calculation fixes

* Can't spend deposit - WIP

* Can't spend deposit - fixes

* New protobuf schema: new EndorseBlock message

* Finalization fix: WIP

* Finalization fix

* New profobuf, fixed compilation issues

* Fixed names in intermediate structures after renaming

* Fixed endorse filter

* Additional logs for voting

* No committed generators

* Handling rollbacks before activation

* Fixes for unit tests

* Fixes for unit tests in ride runner

* API: finalization voting in a block header

* CommitToGenerationTransactionDiff: check free slots and deny dups

* Base58 for BLS entities

* Disable garbage logs in BrokenUnicodeTest

* UtilsRouteEvaluateSpec: fixed releasing resources

* HasSecurityManager: wrapped function to bypass deprecation warning (for now)

* Fix running tests on JVM 17

* Changed data storage and snapshots for committed generators and CommitToGenerationTransaction

* sbtopts: additional flags

* Only a committed generator can do forge and challenge

* Prefilter miner accounts on node

* Store finalization height by height (again)

* Blockchain.loadBlockIds loads blocks from the current finalized block

* Miner: better errors

* EndorsementStorage: fixed bugs, less logs

* PBMicroBlocks.vanilla: fixed FinalizationVoting parsing

* EndorseBlockSpec: fixed maxLength (for old blocks)

* Voting fixes

* scalafmt: preserve lines in docstrings (solves broken good user formatting)

* sbt: added generateGenesisCommand

* GenesisBlockGenerator: nonce = 0 by default

* BlockAppenderSpec: start voting in test

* Common format for fields in error messages in settings validation

* sbt: how to solve "Error response from daemon: No such image: "

* custom-defaults: fixed field name

* WIP: Finalization test, fixes for voting starting

* Concise test logs

* Improving FinalizationTestSuite and fixing bugs in finalization

* Do not add voting information to a micro block if there are no updates in voting

* Fixed compilation issues in tests

* EndorsementStorageSpec updates

* Concise test with signing CommitToGenerationTransaction

* Fixed wrong finalization height

* check-pr.yaml from version-1.5.x to run integration tests and have test reports

* check-pr.yaml removed lang-related steps, because it requires more porting from version-1.5.x

* New procedure of mining scheduling

* CommitToGenerationTransactions: type=19

* Time.monotonicMillis, mining tests

* CatchLogs: fix

* WIP: Finalization voting fixes and improvements, new tests

* Fixed SnapshotBlockchain.currentGeneratorBalances

* Removed not used code

* New protobuf dependency with CommitToGenerationTransaction snapshots

* Fixed microblock signature checking

* Fixed naming

* BlsUtilsTest: new tests

* GET /blocks/finalized/at/$at, additional tests

* Finalization fixes

* Fix: finalizedHeightOrFallback and formatting

* - Removed limit of generators in epoch
- Setting `functionality.max-generators` renamed to `functionality.max-endorsements`

* EndorsementStorage: check non-negative endorser index

* - Fixed bug: the miner of the voting block participate in voting instead of the parent block miner;
- Checking finalization voting calculations in docker tests;
- ReportingTestName.step for logging intermediate steps during big tests.

* Fixed tests, migrated better test reporter from 1.5.x

* Survives restarts, finalized height restored correctly, improved logs

* Fix for last micro block issue

* Test fixes

* WIP: New generation period calculation

* Fixed unit tests

* Fixed compilation issues

* Fixed compilation issues (2)

* Added a docker test with two nodes

* Fixed OneNodeFinalizationTestSuite

* Fixed compilation warnings

* WIP: New voting - send all endorser indexes always

* WIP: New voting - new rules for voting results in microblock

* WIP: New voting - right combination of voting in microblocks

* FIX: removed useless stacktrace in HistoryReplierL1

* FIX: naming

* tests: disable NTP

* typos

* fix: conflict endorser balance excluded from the total balance
new tests

* WIP Penalty for conflict endorsers
added: saving and reading conflict endorsers
added: GeneratorIndex for type safety, migrated code

* WIP Penalty for conflict endorsers
implemented: right waves portfolio for conflicted endorsers

* WIP Penalty for conflict endorsers
implemented: right total waves amount

* WIP Penalty for conflict endorsers
test: checking saved data after reaching new epoch

* WIP Penalty for conflict endorsers
test: balanceAtHeight tests

* test: new TODO tests

* WIP Penalty for conflict endorsers
balanceSnapshots considers conflict endorsements

* WIP Penalty for conflict endorsers
balanceSnapshots considers punishment

* WIP Penalty for conflict endorsers
test: checking generatorsApi

* WIP Penalty for conflict endorsers
test: rollback test for conflict endorsements
fix: SnapshotBlockchain.wavesAmount, right waves amount during block append

* WIP Penalty for conflict endorsers
simplify collectGenerationDepositChanges

* WIP Penalty for conflict endorsers
caches for committed and conflict generators

* Penalty for conflict endorsers
Fixed tests

* New rules for conflict endorsements

* Ignore endorsements from known conflict endorser

* - EndorsementFilter moved to own file, accurate simulate
- Send a non-empty list of valid endorsers only if reached finalization

* Unified BlockEndorsement

* Finalization logs during mining

* Fixed debug message

* Add finalization voting to the microblock signature (#4016)

* Moving tests

* Better logs of committed generators

* Better logs of committed generatorsa (2)

* Fixed not sending endorsements

* Conflict endorsement can lead to finalization

* Safer penalties calculation

* ConflictGenerators: removed not used methods, unit tests

* API fixes

* Fix statehash api (#4018)

* Fix StateHash API
* Add DebugApiRouteStateHashGenesisSpec

* New finalization calculation process - WIP

* Right finalization height after append and force rollbacks, new finalization test

* Deny conflict miner blocks in epoch

* MultipleConflictEndorserSuite

* Can append blocks from a generator not in the generator set if no one eligible committed

* Moving tests

* Fix stateHash field (#4025)

* Conflict generators can forge on new epoch, their blocks appended

* finalized height in voting header

* Conflict height in GeneratorsApiRoute

* GeneratorsApiRoute improvements

* Removed excess logs, log all new conflict endorsers

* Add committed generator balances to the StateHash (#4022)

* Punishment for conflict endorsement in a next block

* New tests

* Fixed resource leak warning in BlockChallengeTest

* wip

* Add nextCommittedGenerators to TxStateSnapshotHashBuilder (#4027)

* Add nextCommittedGenerators to TxStateSnapshotHashBuilder
* Update TxStateSnapshotHashSpec

* Fixed BalanceDiffValidationTest

* Fixes for docker tests (WIP)

* Fixes for docker tests - 2 (WIP)

* Fix for Security Manager error in tests (JRE 21)

* Updated BalanceDiffValidation, fixed LeasingTransactionsSuite

* Removed fix for security manager (doesn't work on JRE 11)

* epoch -> period in code

* ChainIdSpecification for CommitToGenerationTransaction

* Added CommitToGenerationTransaction to RIDE

* WIP: Invalid state hash during challenging fix

* Added CommitToGenerationTransaction validations

* Added FinalizationVoting validation

* Added tests

* Fix an issue during microblock challenging, backported a fix for wrong state hashes

* Backported block challenger fix from invalid-microblock-miner-merged, fixed the test

* Deny commitment if public BLS key is already used

* Deny commitment if public BLS key is already used

* Fixed tests

* Finalization header in challenged block header

* Simpler signing of finalization voting in tests

* Block with unexpected finalized height is invalid, exact error checking in tests

* Filter out generators with insufficient balance

# Conflicts:
#	node/src/main/scala/com/wavesplatform/state/appender/package.scala

* Deny duplicate conflict endorser indexes

* Added nextCommittedGeneratos to StateSnapshotJson

* Fixed formatting

---------

Co-authored-by: Vyatcheslav Suharnikov <arz.freezy@gmail.com>
Co-authored-by: Sergey Nazarov <phearnot@renee.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants