Skip to content

Lb/localnet#951

Open
ldmberman wants to merge 44 commits intomasterfrom
lb/localnet
Open

Lb/localnet#951
ldmberman wants to merge 44 commits intomasterfrom
lb/localnet

Conversation

@ldmberman
Copy link
Member

@ldmberman ldmberman commented Jan 28, 2026

Note

High Risk
Touches consensus-critical paths (mining, recall-range selection, difficulty/VDF validation) behind LOCALNET plus refactors RocksDB open/paths; misconfiguration or macro misuse could affect state bootstrapping or DB usage.

Overview
Adds a new LOCALNET development mode with ar_localnet utilities to start a node from a snapshot, seed data roots/tx data, and optionally create new snapshots; ar gains shell_localnet entrypoints and CI now fetches Git LFS assets plus runs a headless pricing-transition notebook job.

Introduces start_from_state configuration/CLI support to boot from an external state folder (validated to differ from data_dir) by opening snapshot RocksDBs read-only and plumbing CustomDir through ar_storage/ar_node reads; ar_kv is refactored to map-based open/1 with open_readonly/close and updated call sites.

In LOCALNET, mining/validation logic is relaxed or overridden to enable deterministic local mining: swaps in ar_localnet_mining_server via supervisor selection, allows bypassed difficulty/retarget checks, special-cases nonce limiter step comparisons/validation, and allows precomputed recall ranges/step counts for PoA validation.

Written by Cursor Bugbot for commit 7a24c4b. This will update automatically on new commits. Configure here.

@ldmberman ldmberman force-pushed the lb/localnet branch 2 times, most recently from 3fc613f to 954250a Compare February 4, 2026 12:40
Lev Berman added 21 commits February 5, 2026 16:17
- Initialized from a mainnet snapshot.
- No difficulty checks and no retargets for quick blocks.
- Allow for several blocks at the same VDF step.
- Flexible chunk picking.
- Dedicated mining server that builds blocks from sampled chunks.
- Seeded with 20 MiB of early weave data.
- ./bin/localnet_shell
For a start, protocol.mdc only describes a caveat that recall bytes are
independent from sub-chunks, which Claude Opus 4.5 struggled to understand.
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

}),
ar:start_dependencies(),
wait_until_joined(),
submit_snapshot_data(),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timeout error from wait_until_joined is ignored

Medium Severity

The wait_until_joined() function returns {error, timeout} if the node fails to join within the 200-second timeout, but this return value is discarded. The code immediately proceeds to call submit_snapshot_data() regardless, which will fail or produce undefined behavior since the node hasn't finished joining. The return value of wait_until_joined() should be checked, and startup should fail gracefully if the timeout is reached.

Fix in Cursor Fix in Web

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.

1 participant