Skip to content

jamzig/jamtestnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

⚡ JamZig State Transition Test Vectors

JamZig is a Zig-powered implementation of the JAM Protocol. This repository contains state transition test vectors generated by JamZig for cross-implementation testing and validation.

Overview

These test vectors enable teams to validate state transitions by sharing pre-state, block, and post-state data. This allows verification that different implementations can read key objects and perform identical state transitions according to the GP Spec.

The vectors are procedurally generated from a seed, making them deterministic and reproducible. The vectors do not use community-generated keys; instead, all keys are also derived from the same seed.

The format is compatible with: https://github.com/jam-duna/jamtestnet

How to Validate

To validate these test vectors, simply ensure your implementation processes the pre_state from the first transition file (which serves as the genesis state), using the configuration parameters below. Apply each block to its corresponding pre_state following the JAM protocol specifications, then verify your computed post_state matches the provided one.

This assumes teams have implemented the inverse of the state merklization.

Serialization Format

A minimal extension to the merklization of the state as described in the Graypaper D.2. The merklization is a lossy format. This extention introduces minimal metadata for state components and deltas entries. This metadata enables full state deserialization.

See: SERIALIZATION_FORMAT.md

File Structure

state_transitions/  # Machine-friendly state transitions
  $epoch_$slot-in-epoch.json
  $epoch_$slot-in-epoch.bin

File names are output to allow for easy sorting.

Configuration

pub const JAMDUNA_PARAMS = jam_params.Params{
    .epoch_length = 12,
    .ticket_submission_end_epoch_slot = 10,
    .validators_count = 6,
    .validators_super_majority = 5,
    .validator_rotation_period = 4,
    .core_count = 2,
    .avail_bitfield_bytes = (2 + 7) / 8,
    // JAMDUNA changes
    .max_ticket_entries_per_validator = 3, // N
    .max_authorizations_queue_items = 80, // Q
    .max_authorizations_pool_items = 8,
};

Safrole Mode

The test vectors alternate between keys and tickets mode to validate correct state progression and fallback behavior.

Contact

License

MIT

About

JAMZig exports for external teams to validate compatibility and integration.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors