-
Notifications
You must be signed in to change notification settings - Fork 50
[3/x] Typed note inputs #808
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
Draft
greenhat
wants to merge
13
commits into
greenhat/i798-sdk-account-trait
Choose a base branch
from
greenhat/i698-typed-note-inputs
base: greenhat/i798-sdk-account-trait
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[3/x] Typed note inputs #808
greenhat
wants to merge
13
commits into
greenhat/i798-sdk-account-trait
from
greenhat/i698-typed-note-inputs
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
and serialization trait in the `miden-felt-repr-onchain`
…p tests These tests verify the round-trip correctness of serializing data off-chain, passing it to on-chain code where it's deserialized and re-serialized, then deserializing the result off-chain and comparing to the original.
Add test for 5 Felt struct to the super roundtrip tests
Contributor
Author
|
@bitwalker @bobbinth Following our discussion I put the current(temporary) approach with two type definitions in the PR description and made #814 for defining types only once. |
add the test for u64-related bug reproduction.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ref #698
This PR introduces crates for on-chain and off-chain serialization. The reason for two crates instead of one is different
Felttypes. For off-chain, it wrapsu64and for on-chain, it wrapsfloat.The on-chain deserialization trait is at
compiler/felt-repr/onchain/src/lib.rs
Lines 15 to 60 in cccf958
The off-chain deserialization trait is at
compiler/felt-repr/offchain/src/lib.rs
Lines 18 to 59 in cccf958
Although they look identical the only reason for them to be in separate crates is different underlying
Felttype in off-chain and on-chain code (see above). To have it defined only once the schema for user-defined types is discussed at #814.The usage in the P2ID is at
compiler/examples/p2id-note/src/lib.rs
Lines 8 to 14 in cccf958
AccountIdimplementation derived atcompiler/sdk/base-sys/src/bindings/types.rs
Lines 5 to 6 in cccf958
The off-chain code is at
compiler/tests/integration-node/src/node_tests/basic_wallet.rs
Line 86 in cccf958
AccountIdFeltRepr) later themiden-base::AccountIdwill have it derived as well.This PR implements serialization and deserialization parts only to keep the PR size reasonable. The rest of #698 (DX, macros) will be addressed in the subsequent PR.
TODO:
u64-related memory corruption bug;test.dump_codes(artifact_name)that will write wat/ir/masm files somewhere (targetfolder?) ignored by git but not hidden from the editor;basic-walletfrommiden example? Otherwise, release the SDK before updating the basic-wallet example.