Skip to content

Support usdfc burning#249

Merged
ZenGround0 merged 9 commits intomainfrom
feat/burn-txed-stable
Mar 11, 2026
Merged

Support usdfc burning#249
ZenGround0 merged 9 commits intomainfrom
feat/burn-txed-stable

Conversation

@ZenGround0
Copy link
Copy Markdown
Contributor

This is the pdpverifier piece to close out FilOzone/filecoin-services#435

@ZenGround0 ZenGround0 requested review from rvagg and wjmelements March 5, 2026 21:36
@FilOzzy FilOzzy added this to FOC Mar 5, 2026
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Mar 5, 2026
Comment thread src/PDPVerifier.sol Outdated
Comment thread src/PDPVerifier.sol Outdated
Comment thread src/PDPVerifier.sol Outdated
Comment thread src/PDPVerifier.sol Outdated
// USDFC sybil fee support
address public usdfcTokenAddress;
uint256 public usdfcSybilFee;
address public paymentsContractAddress;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is a bit sad .. making pdpverifier aware of the outside world, poor innocent little child, blissfully being concerned about its one thing, now it has to care about two new outside things

IMO a whitelist would have been fine, but whatever

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Haha yeah I know how you feel. It was something @jennijuju really didn't want and ultimately I became convinced this was the least dirty of the two approaches. But I agree still sad.

Comment thread src/PDPVerifier.sol Outdated
Comment thread src/interfaces/IPDPVerifier.sol
@rvagg
Copy link
Copy Markdown
Contributor

rvagg commented Mar 6, 2026

This and FilOzone/filecoin-services#437 seem fine, but have you got any ideas about how we test this without too much hassle? I'm a little worried about the rail->auction mechanism actually working.

@BigLep BigLep moved this from 📌 Triage to ⌨️ In Progress in FOC Mar 6, 2026
Comment thread src/PDPVerifier.sol Outdated
Comment thread src/PDPVerifier.sol Outdated
@ZenGround0
Copy link
Copy Markdown
Contributor Author

This and FilOzone/filecoin-services#437 seem fine, but have you got any ideas about how we test this without too much hassle? I'm a little worried about the rail->auction mechanism actually working.

I'll run a calibnet deployment and test to check that the funds land in the payment contract's account. As long as that is happening we should be good. I can additionally run a microbot that claims auction results to verify that FIL is getting burnt here too.

@rjan90 rjan90 added this to the M4.1: mainnet ready milestone Mar 9, 2026
@BigLep BigLep linked an issue Mar 10, 2026 that may be closed by this pull request
@ZenGround0 ZenGround0 requested review from rvagg and wjmelements March 10, 2026 19:12
Comment thread src/PDPVerifier.sol Outdated

_refundExcessSybilFee(sybilFee);
uint256 balanceAfter = _getPaymentsUsdfcBalance();
ensureBurned(USDFC_SYBIL_FEE > 0 && balanceAfter >= balanceBefore + USDFC_SYBIL_FEE, defaultToFilBurn);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can require USDFC_SYBIL_FEE > 0 in constructor

Comment thread src/PDPVerifier.sol Outdated
function createDataSet(address listenerAddr, bytes calldata extraData) public payable returns (uint256) {
uint256 sybilFee = _validateAndBurnSybilFee();

function createDataSet(address listenerAddr, bytes calldata extraData, bool defaultToFilBurn)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we use msg.value > 0 for defaultToFilBurn?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

actually this is a good suggestion, and we could get rid of the 3-arg form of createDataSet and just use the value transfer as the signal for ensureBurned; caller paying suggests maybe they should pay, but also if they shouldn't we refund them anyway

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

also the overloaded addPieces is the same

Comment thread src/PDPVerifier.sol Outdated

function _getPaymentsUsdfcBalance() internal view returns (uint256) {
if (PAYMENTS_CONTRACT_ADDRESS == address(0) || USDFC_TOKEN_ADDRESS == address(0)) return 0;
try IFilecoinPay(PAYMENTS_CONTRACT_ADDRESS).accounts(USDFC_TOKEN_ADDRESS, PAYMENTS_CONTRACT_ADDRESS) returns (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we do without the try/catch in here? we're already guarded by the if just above so why would this revert? and if it does revert and we're in a new world where Curio isn't sending 0.1 FIL, calls will fail with UsdfcSybilFeeNotMet and you won't know why; should we just make this call and let the revert come from this site if there's going to be one? or is there something about this call that makes it important to try/catch?

@github-project-automation github-project-automation Bot moved this from ⌨️ In Progress to ✔️ Approved by reviewer in FOC Mar 11, 2026
@ZenGround0 ZenGround0 merged commit e653ef0 into main Mar 11, 2026
3 checks passed
@ZenGround0 ZenGround0 deleted the feat/burn-txed-stable branch March 11, 2026 19:19
@github-project-automation github-project-automation Bot moved this to 🎉 Done in PDP Mar 11, 2026
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FOC Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done
Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

Options for the Sybil Fee Payment

6 participants