ergo-lib: add SoftForkVotesCollected and SoftForkStartingHeight Parameter variants#850
Open
mwaddip wants to merge 2 commits into
Open
ergo-lib: add SoftForkVotesCollected and SoftForkStartingHeight Parameter variants#850mwaddip wants to merge 2 commits into
mwaddip wants to merge 2 commits into
Conversation
Add `Parameter::SoftForkVotesCollected` (id 121) and `Parameter::SoftForkStartingHeight` (id 122) so the parameters table can track in-progress soft-fork voting state, mirroring the JVM Ergo node's `Parameters.SoftForkVotesCollected` / `Parameters.SoftForkStartingHeight`. These entries are absent from `parameters_table` unless a vote is in progress, so the new accessors `soft_fork_votes_collected()` and `soft_fork_starting_height()` return `Option<i32>` rather than panic-indexing like the always-present parameter accessors. `Parameters::default()` and `Parameters::new()` are unchanged, so this is backward-compatible: callers that don't reference the new variants are unaffected. `SoftForkDisablingRules` (id 124) is intentionally still not represented: its on-chain encoding is a variable-length `ErgoValidationSettingsUpdate` byte vector, incompatible with the current `HashMap<Parameter, i32>` storage type. Supporting it requires a follow-up change to the storage representation, which is out of scope for this minimal patch.
Coverage Report for CI Build 24077422104Coverage increased (+0.05%) to 86.945%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Introduced by the 6.0 soft-fork (block version 4); auto-inserted by Parameters.update whenever BlockVersion == 4. Testnet blocks include this in their extension fields starting from the first epoch boundary.
mwaddip
added a commit
to mwaddip/ergo-node-rust
that referenced
this pull request
Apr 7, 2026
Sigma-rust integration branch (511c670e) merges feat/ergo-tree-predef with the new feat/parameter-soft-fork-variants branch (PR ergoplatform/sigma-rust#850), which adds Parameter::SoftForkVotesCollected and SoftForkStartingHeight enum variants needed for soft-fork voting state. - All workspace Cargo.tomls bumped from 38d38ece to 511c670e - chain submodule advanced to 23f38f9 (Phase 6: voting + nipopow proofs, +2045 lines, 130+ tests) - facts submodule advanced to e59b3d5 (Phase 6 contract sections plus voting.md, nipopow.md, mempool broadcast docs) - prompts/ added to .gitignore — main session writes prompts as transient working files, no need to track them Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
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.
Adds three Parameter enum variants introduced by the 6.0 soft-fork — SubblocksPerBlock (9), SoftForkVotesCollected (121), SoftForkStartingHeight (122) — with matching Option accessors. Without them, Rust nodes can't represent in-progress soft-fork voting or the sub-blocks parameter.
SoftForkDisablingRules (124) deferred — variable-length encoding doesn't fit HashMap<Parameter, i32>. Additive: defaults unchanged.