Skip to content

ergo-lib: add SoftForkVotesCollected and SoftForkStartingHeight Parameter variants#850

Open
mwaddip wants to merge 2 commits into
ergoplatform:developfrom
mwaddip:feat/parameter-soft-fork-variants
Open

ergo-lib: add SoftForkVotesCollected and SoftForkStartingHeight Parameter variants#850
mwaddip wants to merge 2 commits into
ergoplatform:developfrom
mwaddip:feat/parameter-soft-fork-variants

Conversation

@mwaddip
Copy link
Copy Markdown

@mwaddip mwaddip commented Apr 6, 2026

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.

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.
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 6, 2026

Coverage Report for CI Build 24077422104

Coverage increased (+0.05%) to 86.945%

Details

  • Coverage increased (+0.05%) from the base build.
  • Patch coverage: 53 of 53 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 31665
Covered Lines: 27531
Line Coverage: 86.94%
Coverage Strength: 252697.21 hits per line

💛 - 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>
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.

2 participants