Skip to content

feat(fortuna): Support new Entropy v2 contract #2691

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

jayantk
Copy link
Contributor

@jayantk jayantk commented May 15, 2025

Summary

Update fortuna to set the default_gas_limit field on-chain, and then work with the new Entropy v2 interface. The main changes there are (1) replace the types of ProviderInfo and Request with their V2 variants, and (2) remove the gas_limit parameters from callback submission.

Rationale

we want to support the new version of the contract

How has this been tested?

  • Current tests cover my changes
  • Added new tests
  • Manually tested the code

I've tested this locally against the Entropy contract on blast-testnet (using the EntropyTester to simulate all of the various callback success / failure / out of gas conditions) and it works. I still want to test against a zk chain like Abstract, but that's pending the upgrade right now.

Copy link

vercel bot commented May 15, 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 May 15, 2025 9:09pm
component-library ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2025 9:09pm
entropy-debugger ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2025 9:09pm
entropy-explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2025 9:09pm
insights ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2025 9:09pm
proposals ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2025 9:09pm
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2025 9:09pm

@@ -133,7 +133,7 @@ pub struct EthereumConfig {
pub legacy_tx: bool,

/// The gas limit to use for entropy callback transactions.
pub gas_limit: u64,
pub gas_limit: u32,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

u32 is the size of the field in the contract

Copy link
Collaborator

@m30m m30m left a comment

Choose a reason for hiding this comment

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

I think in this new flow we should always make sure that the gas we set for the transaction is more than what the user requested. Now that the users set the gas limit, this is much easier and we can solve the cases where the gas used can vary a lot (from simulation time to landing time) based on other factors.

.call()
.await?;

// sequence_number == 0 means the request does not exist.
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is this removed? I know that this check exists in some other places, but if we want to be safe and avoid unintended changes, we can keep it as is?

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