Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pulse): add provider #2279

Merged
merged 9 commits into from
Jan 24, 2025
Merged

feat(pulse): add provider #2279

merged 9 commits into from
Jan 24, 2025

Conversation

cctdaniel
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Jan 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-reference ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 24, 2025 4:48am
proposals ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 24, 2025 4:48am
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 24, 2025 4:48am
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
component-library ⬜️ Ignored (Inspect) Visit Preview Jan 24, 2025 4:48am
entropy-debugger ⬜️ Ignored (Inspect) Visit Preview Jan 24, 2025 4:48am
insights ⬜️ Ignored (Inspect) Visit Preview Jan 24, 2025 4:48am

Comment on lines 200 to 201
uint128 providerFeeInWei = _state.providers[provider].feeInWei;
uint256 gasFee = callbackGasLimit * providerFeeInWei;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

as discussed, changed this to use provider fee to protect from future price jumps/drops

Comment on lines -108 to -116
// Check if enough gas remains for callback + events/cleanup
// We need extra gas beyond callbackGasLimit for:
// 1. Emitting success/failure events
// 2. Error handling in catch blocks
// 3. State cleanup operations
if (gasleft() < (req.callbackGasLimit * 3) / 2) {
revert InsufficientGas();
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed this because if insufficient gas error occurs within callback then PriceUpdateCallbackFailed will be emitted with "low-level error (possibly out of gas)" and otherwise if insufficient gas for the executeCallback function itself, it will revert with out-of-gas

Copy link
Collaborator

@ali-bahjati ali-bahjati left a comment

Choose a reason for hiding this comment

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

I thought what we agreed was that the user would not be involved in selecting provider. we instead give exclusivity to providers to update prices early; if they don't do it after a few seconds anyone can do it.

@cctdaniel
Copy link
Contributor Author

cctdaniel commented Jan 22, 2025

I thought what we agreed was that the user would not be involved in selecting provider. we instead give exclusivity to providers to update prices early; if they don't do it after a few seconds anyone can do it.

my understanding regarding to that is that we wanted to go with the cheapest reliable one strategy, and therefore the logic is not that straightforward as it requires us to figure out what is "reliable" for e.g. we would have to design a calculateReliabilityScore function that generates a score based on the provider performance

if we decide to just go with the simple exclusivity option then yeah we can implement this now, i can add this in a following PR

Copy link
Collaborator

@ali-bahjati ali-bahjati left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants