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

Fossil client callback settles round #186

Merged
merged 5 commits into from
Feb 10, 2025

Conversation

eugenPtr
Copy link
Contributor

@eugenPtr eugenPtr commented Jan 28, 2025

Changes Summary

These changes consolidate the settlement process into the fossil callback, removing the need for a separate settlement step and ensuring atomic updates of L1 data and round settlement.

Core Changes

  • Modified fossil_callback in FossilClient to return a FossilCallbackReturn enum instead of void
  • Removed separate settle_round function from Vault contract - settlement now happens directly in fossil_client_callback
  • Added new return types:
    • FossilCallbackReturn enum with variants:
      • RoundSettled(RoundSettledReturn)
      • FirstRoundInitialized
    • RoundSettledReturn struct containing total_payout

Contract Changes

Vault Contract

  • Modified fossil_client_callback to:
    • Handle settlement directly
    • Return the appropriate FossilCallbackReturn variant
    • Not store L1 pricing data anymore
    • Trigger settlement in same transaction

FossilClient Contract

  • Updated interface to include return type
  • Modified callback implementation to propagate return value from vault

Test Changes

  • Removed timeskip_and_settle_round helper as settlement now happens in callback
  • Removed settle_option_round and related methods from VaultFacade
  • Updated test assertions to handle new return values
  • Extracted helper methods from FossilClientFacade into a separate file -> fossil_client_helpers.cairo
  • Modified test cases to work with combined callback/settlement flow

@eugenPtr eugenPtr changed the base branch from main to develop January 28, 2025 16:16
@eugenPtr eugenPtr changed the title Eugen/settle round refactoring Fossil client callback settles round Jan 31, 2025
@eugenPtr eugenPtr marked this pull request as ready for review January 31, 2025 13:53
@0xDegenDeveloper 0xDegenDeveloper merged commit 916330a into develop Feb 10, 2025
1 of 2 checks passed
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