Skip to content

Conversation

petertonysmith94
Copy link
Contributor

@petertonysmith94 petertonysmith94 commented Feb 12, 2025

Release notes

In this release, we:

  • Added support for dynamic-sized configurables in Sway
  • Added the ability to read configurables for scripts and predicates

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

@petertonysmith94 petertonysmith94 added the feat Issue is a feature label Feb 12, 2025
@petertonysmith94 petertonysmith94 self-assigned this Feb 12, 2025
Copy link

vercel bot commented Feb 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fuels-template ❌ Failed (Inspect) Feb 18, 2025 7:08pm
ts-docs ❌ Failed (Inspect) Feb 18, 2025 7:08pm
ts-docs-api ❌ Failed (Inspect) Feb 18, 2025 7:08pm

Copy link
Contributor

github-actions bot commented Jun 18, 2025

Vercel Deployment

Name Preview
fuels-template Success ✅ (Preview)
ts-docs Success ✅ (Preview)
ts-docs-api Success ✅ (Preview)

Comment on lines 82 to 84

[patch.'https://github.com/fuellabs/sway']
std = { git = "https://github.com/fuellabs/sway", branch = "xunilrj/dynamic-types-configurables" }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

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);
// });
Copy link
Contributor Author

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.

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Issue is a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Support for Dynamic Configurables
1 participant