Skip to content

synd-enclave: fix stylus bug#712

Merged
tsite merged 4 commits into
mainfrom
stylus_bug
Aug 11, 2025
Merged

synd-enclave: fix stylus bug#712
tsite merged 4 commits into
mainfrom
stylus_bug

Conversation

@tsite

@tsite tsite commented Aug 10, 2025

Copy link
Copy Markdown
Contributor

Ticket

What does this PR do?

  • Summary:
    • add an in-memory db for storing natively compiled wasm stylus programs while building blocks (first commit)
  • Key Changes:
    • also refactor synd-enclave to increase readability (remaining commits)

Breaking changes?

  • Yes/No:
    • No

Metrics changes?

  • Yes/No:
    • No

Anything interesting?

  • I found a bug with the recreate-missing-state flag: fix: recreate-missing-state-from panic OffchainLabs/nitro#3464
  • running nitro nodes in archive mode is essential, otherwise if the start block for the proof is too old and the state trie has been pruned, the node needs to re-execute all blocks from the genesis block onwards to derive it which can be slow.

How can this PR be tested?

  • ./tee-verifier --start-batch 1030 --end-batch 1040 on manchego no longer fails

tsite added 2 commits August 10, 2025 00:32
move wavm structures to wavmio & split into files to increase
readability

@jorgemmsilva jorgemmsilva left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

💪 great work!

Comment thread synd-withdrawals/synd-enclave/enclave/accumulator.go
Comment on lines +24 to +25
// TODO: make sure spurious errors eg out of memory are not returned by the zlib reader and rlp decoder
// These functions should panic if the compressed data is valid but decoding fails

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lingering TODO
can we just panic if rlp.DecodeBytes return an error?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

that would be nice, but unfortunately invalid compressed data is valid (since the sequencing contract does not validate it) and needs to be ignored instead triggering a panick

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yeah I found that odd, just going off the text in the comment 😄

should panic if the compressed data is valid but decoding fails

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ah the comment is a bit confusing, it's referring to spurious errors - library code such as rlp.DecodeBytes or zlib.NewReader should never return an error if the compressed data if valid but the machine runs out of resources, it should panic instead

@tsite tsite enabled auto-merge (squash) August 11, 2025 17:36
@tsite tsite merged commit 783207f into main Aug 11, 2025
9 checks passed
@tsite tsite deleted the stylus_bug branch August 11, 2025 18:13
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.

2 participants