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: missing block catchup #26

Merged
merged 6 commits into from
Jul 20, 2023
Merged

Conversation

segfault-magnet
Copy link
Contributor

closes: #23

The committer has been altered so that if we find that we haven't tried to commit the latest epoch-divisible block, we will fetch and schedule its commitment.

Known caveats:

  • Will only commit blocks if there were no registered attempts to commit it before. (If the previous attempt failed because of network issues, it won't be retried)
  • In the case of the db being deleted, upon starting it will attempt to commit the latest epoch-divisible block (wasting gas if it was already committed)

Fixing 1. would require separating errors into transient/nontransient and committing if previously the error was transient. Also setting some sort of retry limit per block.

Fixing 2. would require us to add a startup check in case of an empty db that would use the read-only query methods of the fuel state contract to determine whether the latest epoch-divisible block had already been committed.

If you feel either 1 or 2 to be of importance drop a comment and I'll make it into a task.

@segfault-magnet segfault-magnet added the enhancement New feature or request label Jul 13, 2023
@segfault-magnet segfault-magnet self-assigned this Jul 13, 2023
@Voxelot
Copy link
Member

Voxelot commented Jul 13, 2023

The tests look really nice and readable, nice work!

@Voxelot
Copy link
Member

Voxelot commented Jul 13, 2023

issue 2 should probably be solved for (as a followup), as the contract doesn't perform any checking for redundant commits which would reset the finality of the latest epoch block:

https://github.com/FuelLabs/fuel-bridge/blob/main/packages/portal-contracts/contracts/fuelchain/FuelChainState.sol#L89

@segfault-magnet segfault-magnet merged commit 87a41f8 into master Jul 20, 2023
5 checks passed
@mchristopher mchristopher deleted the feat/missing_block_catchup branch August 20, 2024 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Catchup for missing blocks
3 participants