Repository navigation
feat(config): add a private devnet network ([proxy] network = "devnet") - #28
Open
cafebedouin wants to merge 1 commit into
Open
cafebedouin wants to merge 1 commit into
cafebedouin wants to merge 1 commit into
Conversation
…t"`) A third `Network` variant for isolated multi-node testing: magic [7,7,7,7], protocol v4 from genesis with the sub-blocks parameter, testnet genesis boxes and digest, difficulty pinned at 1 by an unreachable difficulty and voting epoch (1 << 25 blocks), a 20 s block interval, the v2 activation height and re-emission rules of testnet (neither reachable), and the testnet address prefix. The profile is a Scala `networkType = "devnet60"` node with those overrides (the mixed Scala/Rust devnet of arkadianet/ergo, `scripts/devnet-mixed/genesis.conf`, runs the same one), so a Scala node, an arkadianet node and this node share one wire. Mainnet and testnet behaviour is unchanged: every touched match adds a `Devnet` arm and the existing arms keep their values. Tests cover the magic and its TOML name, the chain, voting and re-emission parameters, the launch parameters, and that the devnet genesis boxes reproduce the testnet state digest. The example config, the manpage, the operator guide, the facts contracts (config, journal events, p2p node, p2p routing, mining), the changelog and the wire-format magic table name the new network. Co-Authored-By: Claude Fable 5.1 <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.
Prepared with Claude (Anthropic, Claude Fable 5.1) for cafebedouin; the tests and the mixed-implementation run below were executed on this branch head.
Add a private devnet network (
[proxy] network = "devnet") for multi-node testingObserved:
Networkhas two variants,mainnetandtestnet, with magic, genesis boxes, chain and voting parameters compiled in (p2p/src/types.rs,chain/src/config.rs,src/main.rs).Change: a third variant,
devnet: the profile of a ScalanetworkType = "devnet60"node with fixed difficulty, the one the mixed Scala/Rust devnet of arkadianet/ergo (scripts/devnet-mixed/genesis.conf,ChainSpec::devnet()) also runs. Magic[7,7,7,7], protocol v4 from genesis with the sub-blocks parameter, testnet genesis boxes, digest and address prefix, difficulty pinned at 1 by a1 << 25epoch, a 20 s block interval, testnet's re-emission rules and v2-activation height (unreachable, as on testnet). A Scala node, an arkadianet node and this node can then share one wire (the run below pairs this node with the Scala node). A configurable magic for devnet is a separate, stacked pull request.Invariant kept: every touched
matchgains aDevnetarm (or foldsDevnetinto theTestnetarm) and noMainnetorTestnetvalue changes. Falsifier: a public network resolving to a devnet value.Recommended: merge as is; the network is inert unless configured.
Executed:
cargo test -p enr-p2p,cargo test -p enr-chain --lib devnet,cargo test -p ergo-node-rust --bin ergo-node-rust devnet(all pass, captured after the last amend).rustfmt --checkclean on the touched files (the workspace as a whole is not fmt-clean before this change). Not run: the full workspace suite, clippy, other platforms.Evidence:
ERGO-NODE-RUST-FOLLOW: PASS (A=6.0.6 B=0.8.2 followed=yes maxlag=12 SAME@40 SAME@40 topology=ok): this node, built at this commit (sha2564dec759e98e7adbe7562b14df05991ab287ae10186e2ea44e879b42594a07524), dialled an ergo v6.0.6 node mining on the devnet parameters and followed it: same header at height 1, same UTXO state root at an equal height once the miner paused, each node listing the other.To reproduce without the bench that ran it
scripts/devnet-mixed/genesis.confsettings (ergo.networkType = "devnet60", magic[7, 7, 7, 7]),ergo.node.mining = true,offlineGeneration = true,useExternalMiner = false, a slowinternalMinerPollingInterval(2 s: one block per poll at difficulty 1),scorex.network.allowLocal = true.[proxy] network = "devnet", one[listen.*]entry,[outbound] seed_peersnaming the Scala node's P2P address, an[identity]block (agent_name,peer_name,protocol_version; required on every network),[node] state_type = "utxo",blocks_to_keep = -1./inforeport the samefullHeight,headersHeightandstateRoot;/blocks/at/1returns the same id on both; each node's/peers/connectedlists the other. Without this branch, step 2 fails at config load onnetwork = "devnet".