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.
AtomicAssets Track B: end-to-end Docker stack (Jungle 4) + config segment writer #8
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
Uh oh!
There was an error while loading. Please reload this page.
AtomicAssets Track B: end-to-end Docker stack (Jungle 4) + config segment writer #8
Changes from all commits
947de39bb7ff7389d6c2a77c71e5291ce19df72934653c71aFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
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.
There are two potential serialization/deserialization mismatch bugs in
encode_config:collection_formatencoded blob (fmt) has its length prefix capped atu16::MAX, but the entirefmtvector is appended to the output buffer. Iffmt.len() > u16::MAX, this will cause the decoder to desynchronize and corrupt subsequent fields.supported_tokenslength prefix is cast tou16without capping, but the entire list is serialized. Ifsupported_tokens.len() > u16::MAX, the length prefix will truncate (wrap around), but all tokens will still be written, leading to a decoder desynchronization.We should cap both the length prefixes and the serialized slices/iterators to
u16::MAX.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.
Update the test to handle the new
Optionreturn type ofdecode_config.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.
In the Docker/bootstrap path added here,
aa-buildreadsatomicassets-configdocuments created bysnapshot-load --tables atomic; I checkedcrates/snapshot-load/src/atomicassets.rs::map_config, and that producer writescontract, counters,collection_format,supported_tokens, andblock_num, but never aversionfield. As a result every real segment built by this flow falls through to"", so/atomicassets/v1/configserves an empty version even though the binary format and API payload now claim to carry it; this should be sourced from server/contract config or deliberately omitted rather than silently encoding an invalid value.Useful? React with 👍 / 👎.
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.
Fixed — sourced properly rather than emitting a blank.
653c71a: the snapshot-load schema-registry pre-pass now also readsatomicassets:tokenconfigs(the v2{standard, version}table where the contract version actually lives — not theconfigrow) and stashes it onSchemaRegistry;map_configemitsversionwhen present and omits the field on pre-v2 chains that lack tokenconfigs, rather than encoding"".756ed87(companion serve PR) makes /config drop the field when empty too.Validated on Jungle 4:
tokenconfigs.version = "1.3.1"→ the Mongo config doc and/atomicassets/v1/confignow report"1.3.1".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.
When a segment that contains the new
TABLE_AA_CONFIGis later compacted,aa_live::compact_withrebuilds the output throughAtomicBuilder::new()and only replays schemas, templates, and assets; there is no raw config setter/carry-over path, soself.configremainsNoneand this branch omits the config table from the compacted segment. In deployments that use the live overlay/compaction path,/atomicassets/v1/configwill work on the initial snapshot-built segment but disappear after the first compaction.Useful? React with 👍 / 👎.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.