-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: graceful and alertable relayer reorg detection (#5401)
### Description - Only panics in the validator if there is a reorg detected - Mostly solves hyperlane-xyz/issues#1394 (does not have super clear alert conditions for a reorg occurring, this should come later) - Whereas before we would use `Result<Option<Vec<u8>>` as a return type for metadata building, where the Result indicates some error occurred (e.g. an RPC issue or something), Ok(Some(_)) meant that metadata building was successful, and Ok(None) meant that no error occurred but simply that fetching metadata wasn't successful -- we now have a new `Metadata` enum: ``` #[derive(Clone, Debug)] pub enum Metadata { /// Able to fetch metadata Ok(Vec<u8>), /// Unable to fetch metadata, but no error occurred CouldNotFetch, /// While building metadata, encountered something that should /// prohibit all metadata for the message from being built. /// Provides the reason for the refusal. Refused(String), } ``` - When we are building metadata and encounter a reorg flag in a validator that's used by the message, we handle this and return `Metadata::MetadataBuildingRefused`. The aggregation ISM will propagate this to make sure that we have end behavior of flatly refusing to build metadata for a message even if a nested metadata builder encounters this. If this happens, a new reprepare reason `MessageMetadataRefused` is introduced that's used. - e2e test is added to confirm this behavior ### Drive-by changes <!-- Are there any minor or drive-by changes also included? --> ### Related issues <!-- - Fixes #[issue number here] --> ### Backward compatibility <!-- Are these changes backward compatible? Are there any infrastructure implications, e.g. changes that would prohibit deploying older commits using this infra tooling? Yes/No --> ### Testing e2e, some unit --------- Co-authored-by: Daniel Savu <[email protected]>
- Loading branch information
1 parent
23e1f94
commit dfd9e9f
Showing
16 changed files
with
242 additions
and
119 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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.