-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: add support for dynamic configurables #3702
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: master
Are you sure you want to change the base?
feat: add support for dynamic configurables #3702
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…d-support-for-dynamic-configurables
|
||
[patch.'https://github.com/fuellabs/sway'] | ||
std = { git = "https://github.com/fuellabs/sway", branch = "xunilrj/dynamic-types-configurables" } |
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.
[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 |
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.
TODO
/** | ||
* 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); | ||
// }); |
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.
Once the Sway branch has been merged and stabilised, re-evaluate this logic and either remove or implement.
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.
Revert these changes once Sway branch up to date
Release notes
In this release, we:
Checklist