Skip to content

WIP: Payments contract should compile without via-ir being set to true in foundry.toml#149

Draft
pali101 wants to merge 2 commits intoFilOzone:mainfrom
pali101:refactor/payments-remove-via-ir
Draft

WIP: Payments contract should compile without via-ir being set to true in foundry.toml#149
pali101 wants to merge 2 commits intoFilOzone:mainfrom
pali101:refactor/payments-remove-via-ir

Conversation

@pali101
Copy link
Contributor

@pali101 pali101 commented Jun 24, 2025

Refactored the Payments contract to reduce call stack depth and remove the requirement for via-ir in foundry.toml.

Breaking Changes

To address stack depth limits, I had to change function signatures of few external/public function (e.g., settleRail, settleTerminatedRailWithoutArbitration etc). Key changes:

  • Grouped related function parameters into structs (e.g., PermitParams).
  • Replaced multi-variable returns with result structs.
  • Moved some logic to internal helpers.

Remaining work

Update tests to use the new function signatures and verify full functionality.

pali101 added 2 commits June 23, 2025 22:01
- refactor internal settlement logic to use SettlementResult and SettlementState structs for cleaner return handling and avoiding stack-too-deep error.
- replace depositWithPermit() multi-argument signature with a PermitParams struct.
- move arbitration logic out of _settleSegment() into dedicated _runArbitration() helper.
- split modifyRailPayment logic into internal _modifyRailPayment.
- minor grouping, naming, and internal structure improvements.
@pali101 pali101 marked this pull request as draft June 24, 2025 07:05
@pali101 pali101 changed the title Payments contract should compile without via-ir being set to true in foundry.toml WIP: Payments contract should compile without via-ir being set to true in foundry.toml Jun 24, 2025
@aarshkshah1992
Copy link
Contributor

@pali101 Let's get back to this after the M2 milestone. Thanks for your hard work so far.

@BigLep BigLep added this to FOC Jul 17, 2025
@github-project-automation github-project-automation bot moved this to 📌 Triage in FOC Jul 17, 2025
@BigLep
Copy link
Contributor

BigLep commented Mar 17, 2026

@wjmelements : is this still worth doing, or should we close this?

@wjmelements
Copy link
Collaborator

Bummer! This would have been great.

@wjmelements
Copy link
Collaborator

We don't plan to redeploy Payments so let's close

@BigLep BigLep moved this from 📌 Triage to 🐱 Todo in FOC Mar 17, 2026
@BigLep
Copy link
Contributor

BigLep commented Mar 17, 2026

Ack, ok. I'll put this back into todo, so it's there for consideration if we do a filecoin-pay update. If it looks like that isn't going to happen in 2026 then we'll close these open draft PRs.

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

Labels

None yet

Projects

Status: 🐱 Todo
Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants