Fix funding stream address rotation panic at ~35,000 blocks - #25
Open
hyphae-bot wants to merge 1 commit into
Open
Fix funding stream address rotation panic at ~35,000 blocks#25hyphae-bot wants to merge 1 commit into
hyphae-bot wants to merge 1 commit into
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
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.
Problem
All cTAZ testnet nodes crash at approximately block 35,000 with:
The crash occurs in
get_block_template→standard_coinbase_outputs→funding_stream_address, affecting both the internal miner and any externalgetblocktemplateRPC calls.Root Cause
The funding stream address rotation formula (
funding_streams.rs:30-38) computes:where
address_periodchanges every ~35,000 blocks (POST_BLOSSOM_HALVING_INTERVAL / 48).The Crosslink config in
application.rsprovides only 1 address for the funding stream (height range1..99,999,999). Once the chain advances past the first address period boundary, the computed index exceeds the number of available addresses, triggering the assertion panic.Fix
Replace the strict assertion with a modulo wrap:
This cycles through available addresses instead of panicking when the period boundary is crossed.
Testing
Built from s1v4 source with this patch applied. Node successfully syncs and mines past block 35,000 on cTAZ testnet.
Alternative Approaches
For a more permanent solution, consider:
1..99,999,999)should_lock_funding_stream_address_period = trueto always use index 0