Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

fix(protocol/deposit): fix deposit parsing to ensure that all the contract fields are well encoded#3078

Merged
theochap merged 2 commits intomainfrom
theo/fix-proofs-contract
Nov 26, 2025
Merged

fix(protocol/deposit): fix deposit parsing to ensure that all the contract fields are well encoded#3078
theochap merged 2 commits intomainfrom
theo/fix-proofs-contract

Conversation

@theochap
Copy link
Copy Markdown
Member

@theochap theochap commented Nov 22, 2025

Description

Currently the protocol assumes that all the deposit contract fields are encoded using solidity's compiler. Those contracts are trusted by default, but we may want to apply a more defensive programming approach and ensure that all the fields are well formatted anyways.

Copilot AI review requested due to automatic review settings November 22, 2025 01:34
@theochap theochap self-assigned this Nov 22, 2025
@theochap theochap added K-fix Kind: fix A-protocol Area: protocol crates labels Nov 22, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request enhances the defensive validation of deposit contract fields by improving the parsing logic to ensure proper Solidity ABI encoding. While deposit contracts are trusted by default, this change applies more rigorous validation to catch malformed data early.

  • Changes U64 parsing to U256 for offset and length fields to match full 32-byte ABI encoding
  • Adds new error variants with more descriptive messages for various validation failures
  • Implements additional validation for opaque data padding to ensure all padding bytes are zeros

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/protocol/protocol/src/deposits.rs Outdated
Comment thread crates/protocol/protocol/src/deposits.rs Outdated
Comment thread crates/protocol/protocol/src/deposits.rs
Comment thread crates/protocol/protocol/src/deposits.rs Outdated
Comment thread crates/protocol/protocol/src/deposits.rs Outdated
Comment thread crates/protocol/protocol/src/deposits.rs Outdated
Comment thread crates/protocol/protocol/src/deposits.rs Outdated
Comment thread crates/protocol/protocol/src/deposits.rs Outdated
Comment thread crates/protocol/protocol/src/deposits.rs
@theochap theochap force-pushed the theo/fix-proofs-contract branch from ee97e15 to ce1d52e Compare November 24, 2025 23:54
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.9%. Comparing base (15dac07) to head (322fb64).
⚠️ Report is 5 commits behind head on main.
✅ All tests successful. No failed tests found.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@theochap theochap enabled auto-merge November 25, 2025 20:43
@theochap theochap force-pushed the theo/fix-proofs-contract branch from fd94ea9 to 322fb64 Compare November 26, 2025 17:06
@theochap theochap disabled auto-merge November 26, 2025 17:06
@theochap theochap enabled auto-merge November 26, 2025 17:06
@theochap theochap added this pull request to the merge queue Nov 26, 2025
Merged via the queue into main with commit 409c341 Nov 26, 2025
42 of 46 checks passed
@theochap theochap deleted the theo/fix-proofs-contract branch November 26, 2025 18:17
theochap added a commit to ethereum-optimism/optimism that referenced this pull request Dec 10, 2025
…tract fields are well encoded (op-rs/kona#3078)

## Description

Currently the protocol assumes that all the deposit contract fields are
encoded using solidity's compiler. Those contracts are trusted by
default, but we may want to apply a more defensive programming approach
and ensure that all the fields are well formatted anyways.
theochap added a commit to ethereum-optimism/optimism that referenced this pull request Jan 14, 2026
…tract fields are well encoded (op-rs/kona#3078)

## Description

Currently the protocol assumes that all the deposit contract fields are
encoded using solidity's compiler. Those contracts are trusted by
default, but we may want to apply a more defensive programming approach
and ensure that all the fields are well formatted anyways.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A-protocol Area: protocol crates K-fix Kind: fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants