Skip to content
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

feat!: add support for dynamic configurables #1555

Open
wants to merge 37 commits into
base: master
Choose a base branch
from

Conversation

hal3e
Copy link
Contributor

@hal3e hal3e commented Dec 9, 2024

closes: #1481
closes: #1328 as we can read the configurables directly from the binary

Release notes

In this release, we:

  • Added support for dynamic str configurables.
  • Added a new configurables reader to contract, script and predicateabigen that can read configurables directly form the binary.
  • Added struct ConfigurablesReader that can be used to read direct and indirect configurables at runtime and compile time.
  • Added tests for configurables with loades for contracts, scripts and predicates.
  • Updated documentation.

Summary

Breaking Changes

  • Contract Regular and Loader methods code(), contract_id(), code_root, state_root return Result
  • Executable Regular and Loader methods code(), data_offset_in_code, loader_code return Result
  • Configurables's update_constants_in returns Result
  • Predicate's with_configurable returns Result
  • AbiFormatter's decode_configurables argument configurable_data now accepts a &[u8]

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)

@hal3e hal3e added the blocked label Dec 9, 2024
@hal3e hal3e self-assigned this Dec 9, 2024
@hal3e hal3e removed the blocked label Feb 6, 2025
@hal3e hal3e marked this pull request as ready for review February 6, 2025 14:12
@hal3e hal3e requested a review from xunilrj February 6, 2025 14:14
hal3e and others added 8 commits February 10, 2025 14:02
…set (#1593)

<!--
List the issues this PR closes (if any) in a bullet list format, e.g.:
- Closes #ABCD
- Closes #EFGH
-->

<!--
Use this only if this PR requires a mention in the Release
Notes Summary. Valuable features and critical fixes are good
examples. For everything else, please delete the whole section.
-->

In this release, we:

~~- Previously deployed blobs are no longer accessible due to changes in
blob ID calculation. Redeployment is required.~~

Updates blob ID calculation to use the configurable offset instead of
the data offset, aligning with the updated design for scripts and
predicates.

`has_configurable_section_offset` function checks bytes 4 and 7 to
distinguish binary versions. If byte 4 is 0x74 (JMPF), it considers byte
7: 0x02 means legacy, 0x04 means new, and any other value results in an
error.

<!--
Please write a summary of your changes and why you made them.
Not all PRs will be complex or substantial enough to require this
section, so you can remove it if you think it's unnecessary.
-->

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

---------

Co-authored-by: hal3e <[email protected]>
Co-authored-by: Ahmed Sagdati <[email protected]>
Updated the way we access storage slots in the example.
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.

Invalid configurables lead to panic Querying configurable constants and storage from SDK
3 participants