Skip to content

SP1 & USP changes for Tron compatibility#1376

Open
tbwebb22 wants to merge 4 commits intomasterfrom
taylor/sp1-usp-tron-compatibility
Open

SP1 & USP changes for Tron compatibility#1376
tbwebb22 wants to merge 4 commits intomasterfrom
taylor/sp1-usp-tron-compatibility

Conversation

@tbwebb22
Copy link
Contributor

@tbwebb22 tbwebb22 commented Mar 20, 2026

SP1Helios changes to make it compile with Tron solc (0.8.25):
Lower pragma from ^0.8.30 to ^0.8.20 and replace require(condition, CustomError(...)) with if/revert pattern (7 occurrences). The require with custom errors syntax was introduced in Solidity 0.8.26 and is not supported by Tron's solc (0.8.25)

SpokePool changes for Tron solc compatibilty:
Disambiguate two isContract() calls by replacing addr.isContract() with AddressLibUpgradeable.isContract(addr). Two using ... for address directives both bring isContract into scope (AddressLibUpgradeable and AddressUpgradeable via SafeERC20Upgradeable). Solc 0.8.26+ resolves this automatically, but Tron's solc 0.8.25 treats it as an ambiguity error. The explicit call form is equivalent on all compiler versions.

New contract SP1AutoVerifier
New no-op SP1 verifier that accepts any proof bytes (unlike SP1MockVerifier which requires empty proof bytes). This will be used as the verifier SP1Helios will point to on Tron until the Tron 80ms timeout issue is fixed.

@tbwebb22 tbwebb22 requested review from fusmanii and grasphoper March 20, 2026 17:16
@tbwebb22 tbwebb22 marked this pull request as ready for review March 20, 2026 17:16
Copy link
Contributor

@fusmanii fusmanii 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, a few comments

/// @title SP1 Auto Verifier
/// @notice A no-op verifier that accepts any proof. Useful for testing SP1Helios without real proofs.
contract SP1AutoVerifier is ISP1Verifier {
function verifyProof(bytes32, bytes calldata, bytes calldata) external pure {}
Copy link
Contributor

Choose a reason for hiding this comment

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

do you think we should emit an event here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately we can't since its a pure / view function

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

Choose a reason for hiding this comment

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

should we just set this to ^0.8.25 which is the min required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good call, updated to ^0.8.25 here 2eb9ef7

Comment on lines +33 to +34
out-tron-universal
out-tron-spokepool
Copy link
Contributor

@fusmanii fusmanii Mar 20, 2026

Choose a reason for hiding this comment

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

are these part of a new foundry profile? I dont see need any foundry.toml changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah they were in the other branch. Still figuring out the best way to do this - can't handle them in a single foundry profile since they're in different folder locations unfortunately

@tbwebb22
Copy link
Contributor Author

@codex review this PR please

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Nice work!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedtronweb@​6.2.29510010094100

View full report

@grasphoper grasphoper added do not merge do not merge need to audit This PR needs to be audited externally before deploying labels Mar 20, 2026

# Tron-compatible profile for Universal SpokePool and SP1Helios.
# Run with `FOUNDRY_PROFILE=tron-universal forge build`
[profile.tron-universal]
Copy link
Contributor

Choose a reason for hiding this comment

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

there is already profile.tron profile, what is difference between the two? should we consolidate and just have one tron profile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge do not merge need to audit This PR needs to be audited externally before deploying

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants