Skip to content

Hegel Fuzz#230

Draft
SeanCheatham wants to merge 47 commits intomainfrom
hegel-fuzz
Draft

Hegel Fuzz#230
SeanCheatham wants to merge 47 commits intomainfrom
hegel-fuzz

Conversation

@SeanCheatham
Copy link
Copy Markdown
Collaborator

This is just a prototype/experiment to leverage Hegel's generators within an Antithesis workload. The primary use-case is to generate semi-plausible but semantically-invalid scenarios and ensure none of the SUT nodes crash/panic.

@SeanCheatham SeanCheatham added the antithesis-test-filecoin Label to build and run only implementations. label Apr 2, 2026
@SeanCheatham SeanCheatham force-pushed the hegel-fuzz branch 3 times, most recently from 6454357 to fe7d548 Compare April 7, 2026 13:53
Port Go cbor_helpers.go patterns to Rust for building raw CBOR bytes
directly without Filecoin type serializers. Includes helpers for all
major CBOR types (uint64, int64, bytes, text, nil, bool, array),
CID encoding, big integer bytes, and random CID generation.
19 tests covering all encoding paths.
…ypes

Composite generators for Filecoin addresses across all five protocol types
(ID, secp256k1, actor, BLS, delegated) plus invalid protocol edge cases.
Includes placeholder modules for message and block generators.
Implement CBOR SignedMessage generator with fuzzed fields for Filecoin
message format: array(2) [Message, Signature] where Message is array(10)
with varied addresses, nonces, BigInt values, gas params, methods, and
params. Includes edge-case generation for signatures with varied type
bytes and lengths.
…Makefile integration

- Multi-stage Dockerfile: Rust builder → Ubuntu runtime with Python+uv
- Bash entrypoint waits for node multiaddr files before launching binary
- docker-compose.yaml: hegel-workload service with devgen volume mounts
- Makefile: build-hegel-workload target, added to build-all
- Replace fragile rand_byte() with getrandom::getrandom() for proper
  Antithesis-interceptable randomness in CID generation
- Fix mesh_wait busy-poll: await mesh formation before entering main
  event loop instead of re-polling a completed Sleep future
- Add depends_on lotus0 healthy to docker-compose service
Adds k256, blake2b_simd, and hex to Cargo.toml, creates the
src/scenario/ module with placeholder types and actions files.
Add all creation action functions (pick_wallet, create_valid_transfer,
create_nonce_reuse, create_gas_bump, create_nonce_gap, create_semi_valid_msg,
create_fuzzed_msg, create_fuzzed_block) and the build_signed_msg helper.
Includes 5 Hegel property-based tests covering nonce correctness, gas bumping,
nonce gaps, and CBOR validity.
Add ScenarioIO type to hold I/O handles (P2P sender, RPC clients,
runtime handle, topic names) separate from pure-data ScenarioContext.

Delivery actions: publish_msg_p2p, publish_msg_rpc, publish_block_p2p.
Observation actions: observe_chain_head, observe_nonce, observe_mempool,
wait_for_inclusion, pause.

Add base64 dependency for encoding signatures in RPC MpoolPush calls.
Add execute_step() and run_scenario() to the scenario module. The stepper
draws a random action from those available in the current context, executes
it via the corresponding action function, and updates the context with any
results. RPC failures are silently skipped to handle Antithesis fault injection.
Load wallet keystore and create ScenarioIO in main, then run the composable scenario loop when wallets are available, falling back to flat generation otherwise. Also adds Antithesis assertions for key scenario events (RPC acceptance, nonce observation, on-chain inclusion, scenario completion).
- Encode message params as base64 in RPC JSON instead of hardcoded null
- Rename "message included on-chain" assertion to "message left mempool"
  (leaving mempool doesn't guarantee inclusion — could be eviction)
- Reduce wait_for_inclusion timeout from 60s to 20s to keep scenarios moving
The hegel-workload needs access to stress_keystore.json (generated by
genesis-prep at /shared/configs/) to load wallet keys for signing valid
transactions in composable scenarios.
The hegel-workload binary is now built and launched inside the combined
workload image. Remove the standalone Dockerfile, entrypoint, compose
service, Makefile target, and CI references that are no longer needed.
The Antithesis simulation has no internet access, causing hegel-workload
to panic when hegeltest tries to download hegel-core from PyPI at runtime.
Pre-install hegel-core into a venv at build time and set HEGEL_SERVER_COMMAND
so hegeltest uses the local binary directly.
The Rust toolchain was accidentally removed when the Dockerfile was
rewritten. filecoin-ffi requires cargo to build filcrypto from source.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

antithesis-test-filecoin Label to build and run only implementations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant