-
Notifications
You must be signed in to change notification settings - Fork 202
[DataAvailability] add a check for executors passed by a client #8233
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
Merged
UlyanaAndrukhiv
merged 17 commits into
feature/optimistic-sync
from
UlianaAndrukhiv/8204-add-executors-checks
Dec 11, 2025
Merged
Changes from 7 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
0038065
Added validation checks for required executors IDs for optimistic sync
UlyanaAndrukhiv dab8852
Added error handing. Added tests
UlyanaAndrukhiv aecdd15
Added error handling when criteria for exec result for optimistic syn…
UlyanaAndrukhiv c4f1593
Moved errors from common rpc to optimistic sync package
UlyanaAndrukhiv 1382a76
Fixed info provider test
UlyanaAndrukhiv 6c9e292
Small format and godoc refactoring
UlyanaAndrukhiv 55f89ee
Merge branch 'feature/optimistic-sync' into UlianaAndrukhiv/8204-add-…
UlyanaAndrukhiv 1491961
Udded Unwrap method to optimistic_sync errors
UlyanaAndrukhiv b6ff05d
Merge branch 'UlianaAndrukhiv/8204-add-executors-checks' of github.co…
UlyanaAndrukhiv 79c056b
Updated execution result info impl for optimistic_sync by using all e…
UlyanaAndrukhiv 9addcea
Added additional check for agreeing executors count. Updated error ha…
UlyanaAndrukhiv 708500a
Refactored CriteriaNotMetError, added BlockFinalityMismatchError acco…
UlyanaAndrukhiv ed4f7d0
Updated godocs
UlyanaAndrukhiv c26a53e
Refactored check for Criteria not met, updated tests
UlyanaAndrukhiv 440903f
Removed the validation check for required executors count
UlyanaAndrukhiv 8e2e7e1
Moved is sealed logic for fork-aware execution result info into separ…
UlyanaAndrukhiv 80888e7
Updated godocs
UlyanaAndrukhiv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| package optimistic_sync | ||
|
|
||
| import ( | ||
| "errors" | ||
| "fmt" | ||
|
|
||
| "github.com/onflow/flow-go/model/flow" | ||
| ) | ||
|
|
||
| // RequiredExecutorsCountExceededError indicates that the requested number of required executors | ||
| // exceeds the total available execution nodes. | ||
| type RequiredExecutorsCountExceededError struct { | ||
| requiredExecutorsCount int | ||
| availableExecutorsCount int | ||
| } | ||
|
|
||
| func NewRequiredExecutorsCountExceededError(requiredExecutorsCount int, availableExecutorsCount int) *RequiredExecutorsCountExceededError { | ||
| return &RequiredExecutorsCountExceededError{ | ||
| requiredExecutorsCount: requiredExecutorsCount, | ||
| availableExecutorsCount: availableExecutorsCount, | ||
| } | ||
| } | ||
|
|
||
| func (e *RequiredExecutorsCountExceededError) Error() string { | ||
| return fmt.Sprintf("required executors count exceeded: required %d, available %d", | ||
| e.requiredExecutorsCount, e.availableExecutorsCount, | ||
| ) | ||
| } | ||
|
|
||
| func IsRequiredExecutorsCountExceededError(err error) bool { | ||
| var requiredExecutorsCountExceededError *RequiredExecutorsCountExceededError | ||
| return errors.As(err, &requiredExecutorsCountExceededError) | ||
| } | ||
|
|
||
| // UnknownRequiredExecutorError indicates that a required executor ID is not present | ||
| // in the list of active execution nodes. | ||
| type UnknownRequiredExecutorError struct { | ||
| executorID flow.Identifier | ||
| } | ||
|
|
||
| func NewUnknownRequiredExecutorError(executorID flow.Identifier) *UnknownRequiredExecutorError { | ||
| return &UnknownRequiredExecutorError{ | ||
| executorID: executorID, | ||
| } | ||
| } | ||
|
|
||
| func (e *UnknownRequiredExecutorError) Error() string { | ||
| return fmt.Sprintf("unknown required executor ID: %s", e.executorID.String()) | ||
| } | ||
|
|
||
| func IsUnknownRequiredExecutorError(err error) bool { | ||
| var unknownRequiredExecutor *UnknownRequiredExecutorError | ||
| return errors.As(err, &unknownRequiredExecutor) | ||
| } | ||
|
|
||
| // CriteriaNotMetError indicates that the execution result criteria could not be | ||
| // satisfied for a given block, when the block is already sealed. | ||
| type CriteriaNotMetError struct { | ||
| blockID flow.Identifier | ||
| } | ||
|
|
||
| func NewCriteriaNotMetError(blockID flow.Identifier) *CriteriaNotMetError { | ||
| return &CriteriaNotMetError{ | ||
| blockID: blockID, | ||
| } | ||
| } | ||
|
|
||
| func (e *CriteriaNotMetError) Error() string { | ||
| return fmt.Sprintf("block %s is already sealed but the criteria is still not met,", e.blockID) | ||
| } | ||
|
|
||
| func IsCriteriaNotMetError(err error) bool { | ||
| var criteriaNotMetError *CriteriaNotMetError | ||
| return errors.As(err, &criteriaNotMetError) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.