Skip to content

ci(testnet): governance orders, delegations and quick-start replay checks - #19

Merged
EnzinoBB merged 4 commits into
masterfrom
testnet/delegations
Oct 10, 2026
Merged

EnzinoBB merged 4 commits into
masterfrom
testnet/delegations

Conversation

@EnzinoBB

Copy link
Copy Markdown
Collaborator

What this adds

Scenarios for the private 7-node test network (ci/testnet, testnet.yml). They exercise the consensus paths fixed in #9–#12, #17 and #18. Every scenario is off by default and enabled through a workflow_dispatch input or an env variable of run.sh, so the nightly run is unchanged.

Input / env What happens Exercises
dpos_at / DPOS_AT the starter key sends special order 9 (StartingDPOS) #17
reward_round / REWARD_ROUND special order 37: staking + mining on, 1 CS block reward from that round rewards split by stake, path B, #17
min_stake / MIN_STAKE special order 22 (MinStakeValue); with the restart test, the restarted node must apply it again after its quick start, or the run fails #18
delegate / DELEGATE every node delegates to the next one, without a time limit and until a UTC time a few minutes ahead; later some delegations are withdrawn path E (#11), digest over delegation records

Commits:

  • 4cc4f01d signed special transactions (orders 9 and 37) in fund.py.
  • 2c244c21 delegations with and without a time limit.
  • 6946fec8 orders 9 and 37 sent independently. Before, a run with only reward_round silently sent neither. This commit also stops tracking the Python bytecode cache that slipped in with ci: private 7-node test network with state-digest comparison #15, and adds a .gitignore.
  • 393d1fec order 22 and the check that it survives a quick start.

Runs

🤖 Generated with Claude Code

EnzinoBB and others added 4 commits October 9, 2026 13:25
The test network's master key is also its starter key (CREDITS_TESTNET), so
it can sign "managing" special transactions as the hardcoded key does on
mainnet:
- order 9 moves StartingDPOS (rewards are 0 before it, solvercore.cpp);
- order 37 turns staking and mining on with a 1 CS block reward from a
  given round.

fund.py --dpos-at / --reward-round sends both after funding. The user field
is encoded the way APIHandler parses it, and signed the way
Transaction::to_byte_stream_for_sig() serialises a string field. run.sh
passes DPOS_AT / REWARD_ROUND. The workflow gets dpos_at, reward_round and
restart_at inputs.

With rewards on, every block changes the balances of the trusted nodes, so
the STATE DIGEST comparison now covers reward crediting (paths A and B).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fund.py --delegations: every node delegates 1000 CS to the next one without a time limit and
500 CS until a UTC time a few minutes ahead; halfway through the load phase the even nodes
withdraw the first delegation. The nodes then apply, expire and withdraw delegations, and the
STATE DIGEST, which covers the delegation records, must still match on every node.

Enabled with DELEGATE=1 in run.sh, or the 'delegate' input of the Testnet workflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fund.py sent the special orders only when both --dpos-at and --reward-round were set, so a run
with rewards on and the default StartingDPOS (10'000) silently sent neither (run 37943830969:
its state digest stayed the same from block 1000 to 12000). Each order is now sent on its own.

Also stop tracking the Python bytecode cache that slipped in with the first fund.py commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fund.py --min-stake sends special order 22 (minimum stake of a trusted node). With MIN_STAKE set
and the restart test on, run.sh requires the restarted node to log the order twice: once live, and
once more when it is replayed after the quick start. Exposed as the 'min_stake' workflow input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@EnzinoBB EnzinoBB added the testnet Run the private 7-node network workflow on this PR label Oct 10, 2026
@EnzinoBB
EnzinoBB merged commit 591be00 into master Oct 10, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testnet Run the private 7-node network workflow on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant