Skip to content

Conversation

@cctdaniel
Copy link
Contributor

No description provided.

@vercel
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-behjati ali-behjati 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-behjati ali-behjati 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