-
Notifications
You must be signed in to change notification settings - Fork 26
β¨ Enable ssz storage for prover inputs #72
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request enables the storage of prover inputs in SSZ format, as demonstrated by the new test that validates conversion between JSON and SSZ representations.
- Adds a new test file to verify the conversion of prover inputs to SSZ and back to JSON.
- Incorporates debugging code to output JSON files on failure for further inspection.
Files not reviewed (1)
- go.mod: Language not supported
Comments suppressed due to low confidence (1)
src/prover-input/ssz/input_test.go:55
- [nitpick] Consider adding a call to t.Helper() at the beginning of this helper function to improve error reporting clarity in test failures.
func LoadProverInputJSON(t *testing.T, path string) *input.ProverInput {
// store the original and final json in a file | ||
// this is for debugging purposes | ||
// TODO: remove this after fixing the issue | ||
// issue: the uncles and transactions field is not being serialized correctly | ||
// check the original.json and final.json files for more details | ||
os.WriteFile("original.json", originalJSON, 0644) | ||
os.WriteFile("final.json", jsonData, 0644) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debugging file write statements are left in the test; consider removing them or adding a flag to prevent unwanted side effects during automated test runs.
// store the original and final json in a file | |
// this is for debugging purposes | |
// TODO: remove this after fixing the issue | |
// issue: the uncles and transactions field is not being serialized correctly | |
// check the original.json and final.json files for more details | |
os.WriteFile("original.json", originalJSON, 0644) | |
os.WriteFile("final.json", jsonData, 0644) | |
if debugMode { | |
// store the original and final json in a file | |
// this is for debugging purposes | |
// TODO: remove this after fixing the issue | |
// issue: the uncles and transactions field is not being serialized correctly | |
// check the original.json and final.json files for more details | |
os.WriteFile("original.json", originalJSON, 0644) | |
os.WriteFile("final.json", jsonData, 0644) | |
} |
Copilot uses AI. Check for mistakes.
os.WriteFile("original.json", originalJSON, 0644) | ||
os.WriteFile("final.json", jsonData, 0644) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error return from os.WriteFile is not checked; consider handling this error to ensure that debugging outputs are written as expected.
os.WriteFile("original.json", originalJSON, 0644) | |
os.WriteFile("final.json", jsonData, 0644) | |
if err := os.WriteFile("original.json", originalJSON, 0644); err != nil { | |
t.Fatalf("Failed to write original JSON to file: %v", err) | |
} | |
if err := os.WriteFile("final.json", jsonData, 0644); err != nil { | |
t.Fatalf("Failed to write final JSON to file: %v", err) | |
} |
Copilot uses AI. Check for mistakes.
π Description
Enables storage of prover inputs in SSZ format
β Solved Issues
Resolves KKRT-104
π Change
π₯ Breaking Change (if applicable)
π Checklist
type.feat
,type.fix
,type.chore
,type.test
,type.docs
,type.devops
breaking-change
ornon-breaking-change
π Additional Notes