-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle FTI messages in executor (#1787)
Closes #1626 todo: tests / requirements - - [x] query the status of failed forced transactions - [x] prevent non-chargeable txs from being included - [x] handle duplicate relayed txs ids (what should gql api report if there are duplicate FTIs?) - ~NOTE: The current solution is each duplicate gets added to the `skipped_transactions` for the block. We might want to find a different solution if UX is bad--but it's _findable_ at least currently.~ Edit: We are now reporting duplicate txs just like any other execution error for relayed txs. Since they will all have unique nonces in practice, all of their ids will be unique. - [x] ensure that skipped fti's due to invalid state (ie. missing utxo inputs) have their status reported - [x] ensure that sentry nodes also include the status of failed FTIs without failing the processing of the block - [x] ensure users aren't double charged for gas payed on l1 --------- Co-authored-by: mitchell <[email protected]>
- Loading branch information
1 parent
e99b0b4
commit 376894e
Showing
24 changed files
with
1,245 additions
and
102 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use crate::client::schema::{ | ||
schema, | ||
RelayedTransactionId, | ||
U32, | ||
}; | ||
|
||
#[derive(cynic::QueryFragment, Clone, Debug)] | ||
#[cynic( | ||
schema_path = "./assets/schema.sdl", | ||
graphql_type = "Query", | ||
variables = "RelayedTransactionStatusArgs" | ||
)] | ||
pub struct RelayedTransactionStatusQuery { | ||
#[arguments(id: $id)] | ||
pub relayed_transaction_status: Option<RelayedTransactionStatus>, | ||
} | ||
|
||
#[derive(cynic::QueryVariables, Debug)] | ||
pub struct RelayedTransactionStatusArgs { | ||
/// Transaction id that contains the output message. | ||
pub id: RelayedTransactionId, | ||
} | ||
|
||
#[allow(clippy::enum_variant_names)] | ||
#[derive(cynic::InlineFragments, Clone, Debug)] | ||
#[cynic(schema_path = "./assets/schema.sdl")] | ||
pub enum RelayedTransactionStatus { | ||
/// Transaction was included in a block, but the execution was reverted | ||
Failed(RelayedTransactionFailed), | ||
#[cynic(fallback)] | ||
Unknown, | ||
} | ||
|
||
#[derive(cynic::QueryFragment, Clone, Debug, PartialEq, Eq)] | ||
#[cynic(schema_path = "./assets/schema.sdl")] | ||
pub struct RelayedTransactionFailed { | ||
pub block_height: U32, | ||
pub failure: String, | ||
} |
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.