Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jit prover should accept InputJSON format and execute a full block #2730

Conversation

ganeshvanahalli
Copy link
Contributor

@ganeshvanahalli ganeshvanahalli commented Oct 9, 2024

This PR enables Jit binary to parse/accept the validation input in the form of InputJSON format introduced in #2604 and execute a block.

recordBlock function in system_tests has been updated to produce InputJSON using the caller specified WasmTargets instead of just rawdb.TargetWavm.

Here's an example of how to use the feature:

$> go test github.com/offchainlabs/nitro/system_tests --run TestProgramStorage$ --count=1 --recordBlockInputs.WithBaseDir="some_valid_path" --recordBlockInputs.WithTimestampDirEnabled=false --recordBlockInputs.WithBlockIdInFileNameEnabled=false
ok  	github.com/offchainlabs/nitro/system_tests	4.240s

$> make build-jit   
<... snip lots of output ...>

$> ./target/bin/jit --binary target/machines/latest/replay.wasm --cranelift --json-inputs="some_valid_path/TestProgramStorage/block_input.json"
<... expect a clean exit ...>

Resolves NIT-2821

@cla-bot cla-bot bot added the s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA. label Oct 9, 2024
Copy link
Contributor

@tsahee tsahee left a comment

Choose a reason for hiding this comment

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

nice!
small comment

system_tests/common_test.go Outdated Show resolved Hide resolved
system_tests/program_test.go Outdated Show resolved Hide resolved
system_tests/program_test.go Outdated Show resolved Hide resolved
@ganeshvanahalli ganeshvanahalli changed the base branch from master to testcompatibility-goinputjson-rustfiledata October 10, 2024 08:33
arbitrator/jit/src/prepare.rs Show resolved Hide resolved
system_tests/common_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@tsahee tsahee left a comment

Choose a reason for hiding this comment

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

LGTM

@eljobe eljobe merged commit c5087d9 into testcompatibility-goinputjson-rustfiledata Oct 15, 2024
10 checks passed
@eljobe eljobe deleted the jitprover-inputjson-compatibility branch October 15, 2024 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design-approved s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants