Skip to content

Improve identification of CBOR bytecode metadata#1506

Merged
gustavo-grieco merged 2 commits intomasterfrom
bytecode-hash
Mar 13, 2026
Merged

Improve identification of CBOR bytecode metadata#1506
gustavo-grieco merged 2 commits intomasterfrom
bytecode-hash

Conversation

@elopez
Copy link
Copy Markdown
Member

@elopez elopez commented Dec 27, 2025

  • pick the last prefix if several are present, to work in bytecode-in-bytecode scenarios (e.g., a contract that deploys other contracts)
  • identify CBOR length and drop other trailing data (typically constructor arguments)

@gustavo-grieco
Copy link
Copy Markdown
Collaborator

I think this will need some amount of testing, in particular, deploying factories.

elopez added 2 commits March 8, 2026 13:29
* pick the last prefix if several are present, to work in bytecode-in-bytecode scenarios
  (e.g., a contract that deploys other contracts)
* identify CBOR length and drop other trailing data (typically constructor arguments)
In bytecode-in-bytecode scenarios (e.g. a contract deploying another),
the child contract's CBOR prefix can appear in the middle of the parent
bytecode. Previously we only tried the last prefix match and fell back
to full bytecode if it was invalid. Now we try all matches from end to
start and return the first one with a valid CBOR length.
@gustavo-grieco gustavo-grieco merged commit 4974580 into master Mar 13, 2026
19 of 25 checks passed
@gustavo-grieco gustavo-grieco deleted the bytecode-hash branch March 13, 2026 14:50
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