Skip to content

feat(manager): let a host verify its chainforks schedule and ask for forks ✨ - #91

Merged
kp2pml30 merged 1 commit into
v0.6-devfrom
feat/manager-get-forks
Nov 13, 2026
Merged

kp2pml30 merged 1 commit into
v0.6-devfrom
feat/manager-get-forks

Conversation

@kp2pml30

@kp2pml30 kp2pml30 commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Delivery Context

Bottom of stack #92 and its own landing cut: backwards compatible, nothing depends on it landing together

Problem and Outcome

A host that passes its own schedule with --chainforks-path needs to know the manager runs the same schedule, and which forks are active, before it builds a run: a run request may depend on the forks. Now it can ask over the existing websocket

  • New socket method get_forks (GET_FORKS = 8): given a network, a timestamp and network_hash, it answers every fork the network schedules and whether it is active, through the same resolver a run uses, on any connection with or without a run
  • network_hash is keccak256 of the calldata map of the network's activation strings; a different one fails with CHAINFORKS_MISMATCH = 8, an unknown or empty network with UNKNOWN_NETWORK = 7
  • A schedule naming an empty network is rejected at load, also by genvm-tool and the JSON schema
  • manager-api.json and the generated Rust, Python and docs are updated

Non-goal: the shipped schedule and default_network are unchanged; #88 drops the production networks

Implementation and Validation

  • Unit tests of the hash, the resolver and get_forks, with the vector genlayer-node pins
  • A manager-socket system case for get_forks

Summary by CodeRabbit

  • New Features
    • Added a manager request to retrieve a network’s active fork status at a specified time.
    • Requests now verify that the client’s network schedule matches the manager’s, with clear errors for unknown networks or mismatches.
    • Empty network names are rejected during schedule validation.
  • Documentation
    • Documented the new request, its schedule-hash requirement, and related error responses.

…forks ✨

A host that passes its own schedule with `--chainforks-path` proves the manager runs the same one with a hash, then asks which forks are active, before it builds a run

- New socket method `get_forks` answers every fork a network schedules and whether it is active at a timestamp, through the same resolver a run uses, on any connection with or without a run
- `network_hash` is keccak256 of the calldata map of the network's activation strings; a different one fails with `chainforks_mismatch`, an unknown or empty network with `unknown_network`
- A schedule naming an empty network is rejected at load
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The manager socket adds a GetForks request that returns scheduled fork statuses for a network and timestamp. The manager computes a hash for each network’s fork map and checks the client-provided hash before returning the statuses.

Changes: GetForks request

Layer / File(s) Summary
Protocol contract and error codes
crates/modules-interfaces/src/manager_api.rs, docs/website/src/impl-spec/appendix/manager-socket-consts.rst, docs/website/src/impl-spec/appendix/manager-socket.rst
The protocol adds get_forks and the unknown_network and chainforks_mismatch error codes. The specification describes the request fields, response map, hash encoding, and documented error cases.
Hash-checked schedule lookup
implementation/src/manager/chainforks.rs, implementation/src/manager/run.rs, implementation/src/manager/versioning.rs
The schedule stores a hash of each encoded fork map and returns fork activation statuses for a timestamp when the supplied hash matches. The context exposes the schedule, and the RFC3339 datetime decoder is visible to the parent module.
Socket request and response handling
implementation/src/manager/socket.rs
The socket decodes GetForks requests, queries the schedule, maps lookup and decode errors to protocol errors, and sends the response through the control queue.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant ManagerSocket
  participant get_forks_frame
  participant Schedule
  Client->>ManagerSocket: Send GetForks request
  ManagerSocket->>get_forks_frame: Decode and handle frame
  get_forks_frame->>Schedule: scheduled_forks(network, timestamp, host_hash)
  Schedule-->>get_forks_frame: Fork statuses or schedule error
  get_forks_frame-->>ManagerSocket: Encoded response or protocol error
  ManagerSocket-->>Client: Send response through control queue
Loading

Possibly related PRs

  • genlayerlabs/genvm-manager#84: Adds the chain-fork schedule types and methods that this change extends and exposes through the manager context.
Merge Risk: Minimal · up to 826bc

This change adds a get_forks socket method that checks the host's schedule hash and reports which forks are active. No merge-blocking risk was found in the supplied context.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title 'feat(manager): let a host verify its chainforks schedule and ask for forks' matches the main change. The diff adds a GetForks socket method to the manager, a chainforks hash, a scheduled_fo…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title 'feat(manager): let a host verify its chainforks schedule and ask for forks' matches the main change. The diff adds a GetForks socket method to the manager, a chainforks hash, a scheduled_forks check that compares the host hash with the manager hash, and new UnknownNetwork and ChainforksMismatch errors. The title names the host verification and the fork query, which are the primary features. It is concise and conventional. It omits the new error codes and the empty network name validation, which is acceptable because the title does not need every detail.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Clippy (1.99.1)

Clippy execution failed

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9b98991 and 826bc3e.

Files ignored due to path filters: 8

  • crates/modules-interfaces/codegen/data/manager-api.json is excluded by !**/*.json
  • docs/schemas/genvm-chainforks.json is excluded by !**/*.json
  • implementation/src/manager/chainforks_test.rs is excluded by !**/*_test.rs
  • implementation/src/manager/socket_test.rs is excluded by !**/*_test.rs
  • support/tools/genvm-tool/genvm_tool/chainforks.py is excluded by !support/tools/genvm-tool/**
  • support/tools/genvm-tool/unit_tests/test_chainforks.py is excluded by !support/tools/genvm-tool/**
  • tests/runner/origin/manager_api.py is excluded by !**/tests/**
  • tests/system/manager-socket/test.py is excluded by !**/tests/**
Files selected for processing: 7

  • crates/modules-interfaces/src/manager_api.rs
  • docs/website/src/impl-spec/appendix/manager-socket-consts.rst
  • docs/website/src/impl-spec/appendix/manager-socket.rst
  • implementation/src/manager/chainforks.rs
  • implementation/src/manager/run.rs
  • implementation/src/manager/socket.rs
  • implementation/src/manager/versioning.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@github-actions

Copy link
Copy Markdown

GenVM PR actions

Tick a box to run it (the box unticks itself when handled). Actions only run while the PR has the ci-safe label.

  • Force run full tests
  • Provision executor PRs
Commands
  • /genvm-run-tests — run full tests once for the current manager snapshot
  • /merge — queue the exact manager snapshot through the App-owned E2E merge train

@kp2pml30
kp2pml30 added this pull request to stack #92 November 12, 2026 17:25
@kp2pml30 kp2pml30 changed the title feat/manager get forks feat(manager): let a host verify its chainforks schedule and ask for forks ✨ Nov 12, 2026
@kp2pml30
kp2pml30 marked this pull request as ready for review November 12, 2026 17:32
@kp2pml30

Copy link
Copy Markdown
Member Author

/genvm-run-tests

@github-actions

Copy link
Copy Markdown

👀 Full tests are running for 826bc3e43318: open run #43270593763

@kp2pml30

Copy link
Copy Markdown
Member Author

/run-e2e all

@ci-core-e2e-runner

Copy link
Copy Markdown

E2E status was updated. Follow the current E2E and merge checks on this PR. Detailed diagnostics are available internally.

@kp2pml30

Copy link
Copy Markdown
Member Author

/run-e2e all

@ci-core-e2e-runner

Copy link
Copy Markdown

E2E status was updated. Follow the current E2E and merge checks on this PR. Detailed diagnostics are available internally.

@kp2pml30

Copy link
Copy Markdown
Member Author

robo-kp2pml30: @kp2pml30 E2E cannot start for this PR: both runs died in the planner before any build, with the same native crash

  • Runs: 43282442326, 43285891944
  • Job plan / action, step resolve-matrix: taskfiles/runner/scripts/resolve-node-dev-line.sh pipes gh api --paginate --slurp repos/genlayerlabs/genlayer-node/branches into node node-release-line.mjs dev-branch, and node aborts with double free or corruption (!prev) (exit 134)
  • The input is about 100 KB (372 branches) and the script only filters it, so this is the runner's Node.js crashing, not this PR. A genvm-manager PR is the only target that takes this path (studio's run at 17:54Z did not)

Not rerunning again: it reproduced on both. This needs a fix or a runner image change in genlayer-e2e

@kp2pml30

Copy link
Copy Markdown
Member Author

/run-e2e

@ci-core-e2e-runner

Copy link
Copy Markdown

E2E status was updated. Follow the current E2E and merge checks on this PR. Detailed diagnostics are available internally.

@kp2pml30 kp2pml30 self-assigned this Nov 13, 2026
@kp2pml30

Copy link
Copy Markdown
Member Author

/genvm-fast-forward

@github-actions

Copy link
Copy Markdown

🚀 Fast-forwarded v0.6-dev to 826bc3e43318

Open run

@kp2pml30
kp2pml30 merged commit 826bc3e into v0.6-dev Nov 13, 2026
42 of 51 checks passed
@kp2pml30
kp2pml30 deleted the feat/manager-get-forks branch November 13, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant