Skip to content

Conversation

@arr00
Copy link
Contributor

@arr00 arr00 commented Dec 31, 2025

Fixes #????

PR Checklist

  • Tests
  • Documentation
  • Changeset entry (run npx changeset add)

@arr00 arr00 requested a review from a team as a code owner December 31, 2025 18:55
@changeset-bot
Copy link

changeset-bot bot commented Dec 31, 2025

⚠️ No Changeset found

Latest commit: e6c90d2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 31, 2025

Walkthrough

The pull request modifies the Solidity compiler pragma in contracts/utils/cryptography/TrieProof.sol, lowering the minimum required version from ^0.8.27 to ^0.8.26. No code logic, error handling, or control flow changes are present in the modification.

Possibly related PRs

Suggested labels

ignore-changeset

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description is a standard template with an incomplete checklist; it lacks substantive detail about the pragma change but is not unrelated to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly and specifically describes the main change: lowering the Solidity compiler pragma in TrieProof.sol from ^0.8.27 to ^0.8.26.
✨ Finishing touches
  • 📝 Generate docstrings

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
contracts/utils/cryptography/TrieProof.sol (1)

1-230: Complete PR checklist and resolve placeholder issue reference.

The PR description contains a placeholder "Fixes #????" that needs a valid issue number, and the contribution checklist shows unchecked items for tests, documentation, and changeset entry. These should be addressed before merging.

Please:

  1. Fill in the actual issue number that this PR resolves.
  2. Add or verify unit tests for the pragma change.
  3. Update documentation if applicable.
  4. Run npx changeset add to create a changeset entry.
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a83d9aa and e6c90d2.

📒 Files selected for processing (1)
  • contracts/utils/cryptography/TrieProof.sol
⏰ 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). (6)
  • GitHub Check: slither
  • GitHub Check: tests-upgradeable
  • GitHub Check: tests
  • GitHub Check: coverage
  • GitHub Check: tests-foundry
  • GitHub Check: halmos

@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
pragma solidity ^0.8.26;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

fd -t f "TrieProof.sol" --exec wc -l {} \;

Repository: OpenZeppelin/openzeppelin-contracts

Length of output: 127


🏁 Script executed:

cat -n contracts/utils/cryptography/TrieProof.sol | sed -n '1,100p'

Repository: OpenZeppelin/openzeppelin-contracts

Length of output: 5255


🏁 Script executed:

cat -n contracts/utils/cryptography/TrieProof.sol | sed -n '80,95p'

Repository: OpenZeppelin/openzeppelin-contracts

Length of output: 908


🏁 Script executed:

# Check for any require statements with custom errors
rg "require\(" contracts/utils/cryptography/TrieProof.sol -A 1 -B 1

Repository: OpenZeppelin/openzeppelin-contracts

Length of output: 253


🏁 Script executed:

# Check the full TrieProof.sol file for features that might be version-specific
cat -n contracts/utils/cryptography/TrieProof.sol | sed -n '200,235p'

Repository: OpenZeppelin/openzeppelin-contracts

Length of output: 1789


🏁 Script executed:

# Check for foundry/hardhat configuration files
fd -t f "(foundry|hardhat|truffle)" . --max-one-result -o fd -t f "(\.toml|\.js|\.json)" . | grep -E "(foundry|hardhat|truffle)" | head -20

Repository: OpenZeppelin/openzeppelin-contracts

Length of output: 312


🏁 Script executed:

# Look for foundry.toml or hardhat config
find . -name "foundry.toml" -o -name "hardhat.config.*" | head -5

Repository: OpenZeppelin/openzeppelin-contracts

Length of output: 113


🏁 Script executed:

# Check if there are any solidity version constraints in package.json or similar
find . -name "package.json" -o -name "foundry.toml" | xargs cat 2>/dev/null | grep -i "solidity\|0\.8\."

Repository: OpenZeppelin/openzeppelin-contracts

Length of output: 445


🏁 Script executed:

# Check the exact require syntax used and whether via-ir is mentioned anywhere
rg "via.ir|viaIR" . --type sol --type toml --type json

Repository: OpenZeppelin/openzeppelin-contracts

Length of output: 106


🏁 Script executed:

# Search for any references to compiler settings or pragma requirements
rg "pragma solidity" . --type sol | head -20

Repository: OpenZeppelin/openzeppelin-contracts

Length of output: 106


🏁 Script executed:

cat foundry.toml

Repository: OpenZeppelin/openzeppelin-contracts

Length of output: 659


🏁 Script executed:

cat hardhat.config.js | head -50

Repository: OpenZeppelin/openzeppelin-contracts

Length of output: 1356


🏁 Script executed:

# Check if there's any CI/test configuration that tests with 0.8.26
rg "0\.8\.26" . --type json --type js --type toml

Repository: OpenZeppelin/openzeppelin-contracts

Length of output: 262


🏁 Script executed:

# Search for any workarounds or comments about the require syntax
rg "require\(" contracts/utils/cryptography/TrieProof.sol -B 2 -A 2

Repository: OpenZeppelin/openzeppelin-contracts

Length of output: 374


Revert pragma to ^0.8.27 or refactor the require statement for 0.8.26 compatibility.

The require(err == ProofError.NO_ERROR, TrieProofTraversalError(err)) syntax at line 86 uses the custom error overload that is only supported in Solidity 0.8.26 via the via-ir compilation pipeline. Since the project's default configuration uses the legacy pipeline (IR disabled by default in hardhat.config.js), the code will fail to compile with 0.8.26 unless via-ir is explicitly enabled. The pragma ^0.8.26 misleadingly suggests compatibility with 0.8.26's default compilation mode.

Either revert the pragma to ^0.8.27 or refactor the error handling to work with 0.8.26 legacy pipeline:

require(err == ProofError.NO_ERROR);
if (err != ProofError.NO_ERROR) revert TrieProofTraversalError(err);
🤖 Prompt for AI Agents
contracts/utils/cryptography/TrieProof.sol around line 2 (and specifically the
require at line 86): the current pragma ^0.8.26 combined with the require(err ==
ProofError.NO_ERROR, TrieProofTraversalError(err)) uses custom error overloads
that only work with the via-ir pipeline in 0.8.26 and will fail under the
project's legacy compiler; fix by either (A) change the pragma to ^0.8.27 so the
syntax is supported by the default compiler, or (B) refactor the check to be
compatible with 0.8.26 legacy pipeline by replacing the single overloaded
require with a plain require(err == ProofError.NO_ERROR); followed immediately
by if (err != ProofError.NO_ERROR) revert TrieProofTraversalError(err); ensuring
no other similar overloaded-require usages remain.

@arr00 arr00 changed the title Minimize trieproof pragma Minimize TrieProof.sol pragma Dec 31, 2025
@ernestognw
Copy link
Member

Shall we cherry pick to 5.6?

@arr00
Copy link
Contributor Author

arr00 commented Dec 31, 2025

Shall we cherry pick to 5.6?

I say yes

@arr00
Copy link
Contributor Author

arr00 commented Jan 2, 2026

Didn't merge this since I'm confused on something here.

https://github.com/argotorg/solidity/blob/develop/Changelog.md#0827-2024-09-04

0.8.27 changelog has the following:

Make require(bool, Error) available when using the legacy pipeline.

We test pragmas using the legacy pipeline, but it still succeeds on 0.8.26. Any idea why?

@Amxx Amxx added this to the 5.6 milestone Jan 7, 2026
@arr00 arr00 merged commit 1e5b891 into OpenZeppelin:master Jan 7, 2026
24 of 25 checks passed
@arr00 arr00 deleted the chore/minimize-pragma branch January 7, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants