Skip to content

fix: use dot-delimited type strings for dynamic record and future#1210

Merged
marshacb merged 1 commit intofeat/dynamic-dispatchfrom
fix/dynamic-type-str-consistency
Mar 2, 2026
Merged

fix: use dot-delimited type strings for dynamic record and future#1210
marshacb merged 1 commit intofeat/dynamic-dispatchfrom
fix/dynamic-type-str-consistency

Conversation

@marshacb
Copy link
Copy Markdown
Collaborator

@marshacb marshacb commented Feb 26, 2026

Motivation

The ValueType::DynamicRecord and ValueType::DynamicFuture variants in get_inputs() serialize their type strings with underscores (dynamic_record, dynamic_future) instead of dots (dynamic.record, dynamic.future). This is inconsistent with snarkVM's Display implementation for these types (value_type/parse.rs:71-72).


Note

Medium Risk
Changes the serialized type strings returned by Program.getFunctionInputs() for DynamicRecord/DynamicFuture, which may break consumers relying on the previous underscore format.

Overview
Fixes Program.getFunctionInputs() to serialize ValueType::DynamicRecord and ValueType::DynamicFuture using dot-delimited type strings (dynamic.record, dynamic.future) instead of underscore-delimited variants.

This brings the WASM program-introspection output in line with snarkVM’s type string conventions.

Written by Cursor Bugbot for commit f7e79a9. This will update automatically on new commits. Configure here.

@marshacb marshacb marked this pull request as ready for review March 2, 2026 17:53
@marshacb marshacb merged commit ede3cb1 into feat/dynamic-dispatch Mar 2, 2026
22 of 23 checks passed
@marshacb marshacb deleted the fix/dynamic-type-str-consistency branch March 2, 2026 23:50
iamalwaysuncomfortable pushed a commit that referenced this pull request Mar 11, 2026
iamalwaysuncomfortable pushed a commit that referenced this pull request Mar 24, 2026
iamalwaysuncomfortable pushed a commit that referenced this pull request Mar 24, 2026
iamalwaysuncomfortable pushed a commit that referenced this pull request Mar 25, 2026
iamalwaysuncomfortable pushed a commit that referenced this pull request Mar 26, 2026
iamalwaysuncomfortable added a commit that referenced this pull request Mar 26, 2026
* Change SnarkVM dep to latest rev on the corresponding SnarkVM:feat/dynamic-dispatch branch

* [Fix] add WASM support for dynamic dispatch variant types (#1199)

* Add WASM support for dynamic dispatch variant types (DynamicRecord, DynamicFuture, RecordWithDynamicID, ExternalRecordWithDynamicID)

* fmt

* fix(wasm): normalize dynamic dispatch type strings to match snarkVM serialization and add missing doc comments

* add JS/TS fixture tests for dynamic dispatch variant types (record_dynamic, record_with_dynamic_id, external_record_with_dynamic_id)

* fix: use dot-delimited type strings for dynamic.record and dynamic.future to match snarkVM (#1210)

* Handle Consensus V14 in deployments (#1230)

* Handle Consensus V14 in deployments

* Remove redundant .map_err in latest_stateroot call

* Update getOrInitConsensusVersionTestHeights tests and doc comments to handle all currently active test version heights

* Deallocate deployment cost tuple

* Update SnarkVM rev for dynamic dispatch

* [Feature] Create stringToField utility (#1237)

* Add stringToField utility function for converting program and function names to fields for dynamic dispatch

* Add exports of the stringToField utility in the js SDK

* [Feature] Re-export dynamic record from SnarkVM (#1236)

* Add the dynamic record type

* Add JS side tests for the DynamicRecord type

* Check visibility on record conversion roundtrip

---------

Signed-off-by: Mike Turner <mike@provable.com>

* [Feature] Updates to make AMM tests work. (#1241)

* Handle Consensus V14 in deployments (#1230)

* Handle Consensus V14 in deployments

* Remove redundant .map_err in latest_stateroot call

* Update getOrInitConsensusVersionTestHeights tests and doc comments to handle all currently active test version heights

* Deallocate deployment cost tuple

* Updates to make AMM tests works

* Also handle upgrade

* Address feedback

* Cleanup

* Cargo fmt lints

* Revert .gitignore changes unrelated to this PR

* Change core rev to the testnet 4.6.0 candidate

* Bump version update to v0.9.18

* Remove unecessary dependencies in the workspace root

---------

Co-authored-by: Mike Turner <mike@provable.com>

* [Chore] Upgrade external signing for dynamic dispatch inputs. (#1266)

* Upgrade external signing for extra dynamic dispatch input types

* Update JS tests to account for external signing

* Address copilot nits

* Address copilot nits

---------

Signed-off-by: Mike Turner <mike@provable.com>
Co-authored-by: marshacb <cameron.marshall12@gmail.com>
Co-authored-by: d0cd <23022326+d0cd@users.noreply.github.com>
iamalwaysuncomfortable added a commit that referenced this pull request Mar 31, 2026
* Change SnarkVM dep to latest rev on the corresponding SnarkVM:feat/dynamic-dispatch branch

* [Fix] add WASM support for dynamic dispatch variant types (#1199)

* Add WASM support for dynamic dispatch variant types (DynamicRecord, DynamicFuture, RecordWithDynamicID, ExternalRecordWithDynamicID)

* fmt

* fix(wasm): normalize dynamic dispatch type strings to match snarkVM serialization and add missing doc comments

* add JS/TS fixture tests for dynamic dispatch variant types (record_dynamic, record_with_dynamic_id, external_record_with_dynamic_id)

* fix: use dot-delimited type strings for dynamic.record and dynamic.future to match snarkVM (#1210)

* Handle Consensus V14 in deployments (#1230)

* Handle Consensus V14 in deployments

* Remove redundant .map_err in latest_stateroot call

* Update getOrInitConsensusVersionTestHeights tests and doc comments to handle all currently active test version heights

* Deallocate deployment cost tuple

* Update SnarkVM rev for dynamic dispatch

* [Feature] Create stringToField utility (#1237)

* Add stringToField utility function for converting program and function names to fields for dynamic dispatch

* Add exports of the stringToField utility in the js SDK

* [Feature] Re-export dynamic record from SnarkVM (#1236)

* Add the dynamic record type

* Add JS side tests for the DynamicRecord type

* Check visibility on record conversion roundtrip

---------

Signed-off-by: Mike Turner <mike@provable.com>

* [Feature] Updates to make AMM tests work. (#1241)

* Handle Consensus V14 in deployments (#1230)

* Handle Consensus V14 in deployments

* Remove redundant .map_err in latest_stateroot call

* Update getOrInitConsensusVersionTestHeights tests and doc comments to handle all currently active test version heights

* Deallocate deployment cost tuple

* Updates to make AMM tests works

* Also handle upgrade

* Address feedback

* Cleanup

* Cargo fmt lints

* Revert .gitignore changes unrelated to this PR

* Change core rev to the testnet 4.6.0 candidate

* Bump version update to v0.9.18

* Remove unecessary dependencies in the workspace root

---------

Co-authored-by: Mike Turner <mike@provable.com>

* [Chore] Upgrade external signing for dynamic dispatch inputs. (#1266)

* Upgrade external signing for extra dynamic dispatch input types

* Update JS tests to account for external signing

* Address copilot nits

* Address copilot nits

---------

Signed-off-by: Mike Turner <mike@provable.com>
Co-authored-by: marshacb <cameron.marshall12@gmail.com>
Co-authored-by: d0cd <23022326+d0cd@users.noreply.github.com>
iamalwaysuncomfortable added a commit that referenced this pull request Mar 31, 2026
….6.0 (#1276)

* [Chore] Merge dynamic dispatch into testnet (#1261)

* Change SnarkVM dep to latest rev on the corresponding SnarkVM:feat/dynamic-dispatch branch

* [Fix] add WASM support for dynamic dispatch variant types (#1199)

* Add WASM support for dynamic dispatch variant types (DynamicRecord, DynamicFuture, RecordWithDynamicID, ExternalRecordWithDynamicID)

* fmt

* fix(wasm): normalize dynamic dispatch type strings to match snarkVM serialization and add missing doc comments

* add JS/TS fixture tests for dynamic dispatch variant types (record_dynamic, record_with_dynamic_id, external_record_with_dynamic_id)

* fix: use dot-delimited type strings for dynamic.record and dynamic.future to match snarkVM (#1210)

* Handle Consensus V14 in deployments (#1230)

* Handle Consensus V14 in deployments

* Remove redundant .map_err in latest_stateroot call

* Update getOrInitConsensusVersionTestHeights tests and doc comments to handle all currently active test version heights

* Deallocate deployment cost tuple

* Update SnarkVM rev for dynamic dispatch

* [Feature] Create stringToField utility (#1237)

* Add stringToField utility function for converting program and function names to fields for dynamic dispatch

* Add exports of the stringToField utility in the js SDK

* [Feature] Re-export dynamic record from SnarkVM (#1236)

* Add the dynamic record type

* Add JS side tests for the DynamicRecord type

* Check visibility on record conversion roundtrip

---------

Signed-off-by: Mike Turner <mike@provable.com>

* [Feature] Updates to make AMM tests work. (#1241)

* Handle Consensus V14 in deployments (#1230)

* Handle Consensus V14 in deployments

* Remove redundant .map_err in latest_stateroot call

* Update getOrInitConsensusVersionTestHeights tests and doc comments to handle all currently active test version heights

* Deallocate deployment cost tuple

* Updates to make AMM tests works

* Also handle upgrade

* Address feedback

* Cleanup

* Cargo fmt lints

* Revert .gitignore changes unrelated to this PR

* Change core rev to the testnet 4.6.0 candidate

* Bump version update to v0.9.18

* Remove unecessary dependencies in the workspace root

---------

Co-authored-by: Mike Turner <mike@provable.com>

* [Chore] Upgrade external signing for dynamic dispatch inputs. (#1266)

* Upgrade external signing for extra dynamic dispatch input types

* Update JS tests to account for external signing

* Address copilot nits

* Address copilot nits

---------

Signed-off-by: Mike Turner <mike@provable.com>
Co-authored-by: marshacb <cameron.marshall12@gmail.com>
Co-authored-by: d0cd <23022326+d0cd@users.noreply.github.com>

* Bump version update to v0.10.0

* Remove duplicate input

* Bump SnarkVM dependency to 4.6.0

* Bump SDK version to v0.10.1

---------

Signed-off-by: Mike Turner <mike@provable.com>
Co-authored-by: marshacb <cameron.marshall12@gmail.com>
Co-authored-by: d0cd <23022326+d0cd@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants