feat: add support for dynamic configurables#3702
Draft
petertonysmith94 wants to merge 29 commits intomasterfrom
Draft
feat: add support for dynamic configurables#3702petertonysmith94 wants to merge 29 commits intomasterfrom
petertonysmith94 wants to merge 29 commits intomasterfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…d-support-for-dynamic-configurables
Contributor
Comment on lines
+82
to
+84
|
|
||
| [patch.'https://github.com/fuellabs/sway'] | ||
| std = { git = "https://github.com/fuellabs/sway", branch = "xunilrj/dynamic-types-configurables" } No newline at end of file |
Contributor
Author
There was a problem hiding this comment.
Suggested change
| [patch.'https://github.com/fuellabs/sway'] | |
| std = { git = "https://github.com/fuellabs/sway", branch = "xunilrj/dynamic-types-configurables" } |
| * @returns The mutated bytecode. | ||
| */ | ||
| set: (configurableValues: { [name: string]: unknown }) => { | ||
| // TODO: add assertions for no configurables |
Comment on lines
+52
to
+68
| /** | ||
| * Expected to have to shift the indirect "dynamic offsets" to point to new values. | ||
| * However, the Sway code compiles and runs with the pre-existing values. | ||
| * Check that this is the case once everything is merged and ready | ||
| */ | ||
| // // Adjust the indirect configurable offsets to point to the new data offsets for the loader | ||
| // const dataOffset = getBytecodeDataOffset(arrayify(bytecode)); | ||
| // const newIndirectConfigurableOffsetDiff = configurableOffset - dataOffset; | ||
| // const dynamicOffsetCoder = new BigNumberCoder('u64'); | ||
| // abi.configurables | ||
| // .filter((configurable) => configurable.indirect ?? false) | ||
| // .forEach((configurable) => { | ||
| // const [existingOffset] = dynamicOffsetCoder.decode(bytecode, configurable.offset); | ||
| // const newOffset = existingOffset.sub(newIndirectConfigurableOffsetDiff); | ||
| // const newOffsetBytes = dynamicOffsetCoder.encode(newOffset); | ||
| // bytecode.set(newOffsetBytes, configurable.offset); | ||
| // }); |
Contributor
Author
There was a problem hiding this comment.
Once the Sway branch has been merged and stabilised, re-evaluate this logic and either remove or implement.
Contributor
Author
There was a problem hiding this comment.
Revert these changes once Sway branch up to date
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
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.
Release notes
In this release, we:
Checklist