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!(gear-core): check data section for uploading codes #3733

Merged
merged 5 commits into from
Feb 19, 2024

Conversation

grishasobol
Copy link
Member

@grishasobol grishasobol commented Feb 12, 2024

Add checking that data section lies inside static memory (or inside wasm min memory pages).

After runtime upgrade codes with incorrect data sections cannot be re-instrumented or uploaded.

Insignificant:

  1. rename MAX_WASM_PAGE_COUNT -> MAX_WASM_PAGE_AMOUNT
  2. forward std feature to wasmparser deps.
  3. refactoring for CodeError: now it contains new internal errors from other crates in order to log full information about code errors in one place: see try_new_code in pallets/gear/src/lib.rs.
  4. remove InitializationError and add DataSectionError

@grishasobol grishasobol self-assigned this Feb 12, 2024
@grishasobol grishasobol added the A1-inprogress Issue is in progress or PR draft is not ready to be reviewed label Feb 12, 2024
@grishasobol grishasobol added A0-pleasereview PR is ready to be reviewed by the team and removed A1-inprogress Issue is in progress or PR draft is not ready to be reviewed labels Feb 15, 2024
Copy link
Member

@gshep gshep left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

core/src/code/utils.rs Show resolved Hide resolved
@grishasobol grishasobol merged commit ce70b73 into master Feb 19, 2024
10 checks passed
@grishasobol grishasobol deleted the gsobol-check-data-section branch February 19, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A0-pleasereview PR is ready to be reviewed by the team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants