Skip to content

Conversation

@georgehao
Copy link
Member

@georgehao georgehao commented Dec 12, 2025

1. Purpose or design rationale of this PR

insert bytecode into witness for EXTCODEHASH opcode

2. PR title

Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:

  • build: Changes that affect the build system or external dependencies (example scopes: yarn, eslint, typescript)
  • ci: Changes to our CI configuration files and scripts (example scopes: vercel, github, cypress)
  • docs: Documentation-only changes
  • feat: A new feature
  • fix: A bug fix
  • perf: A code change that improves performance
  • refactor: A code change that doesn't fix a bug, or add a feature, or improves performance
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • test: Adding missing tests or correcting existing tests

3. Deployment tag versioning

Has the version in params/version.go been updated?

  • This PR doesn't involve a new deployment, git tag, docker image tag, and it doesn't affect traces
  • Yes

4. Breaking change label

Does this PR have the breaking-change label?

  • This PR is not a breaking change
  • Yes

Summary by CodeRabbit

  • Bug Fixes

    • Ensured consistent recording of contract/code data during state lookups so related operations behave uniformly.
  • Chores

    • Bumped patch version (minor release increment) to reflect recent fixes and updates.

✏️ Tip: You can customize this high-level summary in your review settings.

@georgehao georgehao requested review from Thegaram and lispc December 12, 2025 08:31
@coderabbitai
Copy link

coderabbitai bot commented Dec 12, 2025

Walkthrough

When a state object exists, GetKeccakCodeHash now records the object's code into the witness by calling AddCode; additionally, the params package patch version constant was bumped from 0 to 1, updating the computed Version and derived version strings.

Changes

Cohort / File(s) Summary
Witness recording in state DB
core/state/statedb.go
Call AddCode(stateObject.Code(s.db)) inside GetKeccakCodeHash when a state object exists to record the code into the witness (behavior mirrors GetCode/GetCodeSize).
Version patch bump
params/version.go
Increment VersionPatch from 0 to 1, updating Version and related version-derived strings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Small, focused changes across two files.
  • Areas to check:
    • core/state/statedb.go: ensure witness nullability/side effects handled consistently with GetCode/GetCodeSize.
    • params/version.go: confirm version constant change updates any release/process automation expectations.

Possibly related PRs

Suggested labels

bump-version

Suggested reviewers

  • lightsing
  • Thegaram

Poem

🐰 I hopped through code both short and long,
I added witness to the song,
A tiny bump, a tidy seam,
Now keccak's code will too be seen. ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title does not follow the conventional commits format required by the repository; it lacks a required type prefix (feat, fix, etc.). Prepend a conventional commit type prefix (e.g., 'feat:' or 'fix:') to the title, making it 'feat: insert bytecode into witness for EXTCODEHASH opcode'.
Description check ⚠️ Warning The PR description is incomplete and filled with only the template structure; required sections lack substantive content and checkboxes remain unchecked. Complete section 1 with design rationale, select the appropriate conventional commit type in section 2, and check the applicable boxes for versioning and breaking change labels.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/bytecode_to_witness

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 23721c1 and 065e1b5.

📒 Files selected for processing (1)
  • params/version.go (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test
  • GitHub Check: Analyze (go)
🔇 Additional comments (1)
params/version.go (1)

27-27: LGTM! Version patch increment is appropriate.

The patch version bump from 0 to 1 is correctly applied and aligns with the nature of the changes described in the PR summary, which adds code recording to the witness for consistency with existing behavior in related functions.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

lispc
lispc previously approved these changes Dec 12, 2025
Thegaram
Thegaram previously approved these changes Dec 14, 2025
Copy link

@Thegaram Thegaram left a comment

Choose a reason for hiding this comment

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

Looks good. Please also bump version.

@georgehao georgehao dismissed stale reviews from Thegaram and lispc via 065e1b5 December 16, 2025 06:39
@georgehao georgehao requested review from Thegaram and lispc December 16, 2025 06:39
@georgehao georgehao merged commit cf46806 into develop Dec 16, 2025
14 checks passed
@georgehao georgehao deleted the feat/bytecode_to_witness branch December 16, 2025 06:53
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.

4 participants