-
Notifications
You must be signed in to change notification settings - Fork 37
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
chore(starknet_batcher): fix error message on transaction provider error on l1 validation #4187
chore(starknet_batcher): fix error message on transaction provider error on l1 validation #4187
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
18e1709
to
f651936
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @alonh5 and @yair-starkware)
crates/starknet_batcher/src/transaction_provider.rs
line 25 at r2 (raw file):
tx_hash.0.to_hex_string(), validation_status )]
Note the to_hex_string()
is necessary; otherwise, it is printed as:
L1Handler transaction validation failed for tx with hash 508293130354954486128899687620408279632791738070753331087816184264451379717 status ConsumedOnL1OrUnknown.
i.e., the hash is presented as decimal instead of as hexadecimal.
Code quote:
#[error(
"L1Handler transaction validation failed for tx with hash {} status {:?}.",
tx_hash.0.to_hex_string(),
validation_status
)]
be1749d
to
a0f83d3
Compare
f651936
to
60a14dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @alonh5)
60a14dc
to
13c043d
Compare
a0f83d3
to
0884056
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @yair-starkware)
crates/starknet_batcher/src/transaction_provider_test.rs
line 221 at r2 (raw file):
assert_matches!( result, Err(TransactionProviderError::L1HandlerTransactionValidationFailed { .. })
Why? Let's check the values as well. When you're using ..
it only matches the pattern
…ror on l1 validation
13c043d
to
f03eeee
Compare
0884056
to
e6d3862
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @alonh5 and @yair-starkware)
crates/starknet_batcher/src/transaction_provider_test.rs
line 221 at r2 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Why? Let's check the values as well. When you're using
..
it only matches the pattern
Done.
This does revel an issue with the structure of the enum L1ValidationStatus
. It has too many variants that act too diferently. What would happen if a new variant of status will be added? What if it is considered valid? or invalid?
Added a todo (For post 0.14.0).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @alonh5 and @yair-starkware)
crates/starknet_l1_provider_types/src/lib.rs
line 26 at r3 (raw file):
// TODO(Arni): Consider splitting this enum into valid and invalid status where the invalid status // holds the flavor of the invalidity. Propagate this change to // [TransactionProviderError::L1HandlerTransactionValidationFailed].
This TODO is handled in #4256.
Code quote:
// TODO(Arni): Consider splitting this enum into valid and invalid status where the invalid status
// holds the flavor of the invalidity. Propagate this change to
// [TransactionProviderError::L1HandlerTransactionValidationFailed].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ArniStarkware and @yair-starkware)
crates/starknet_batcher/src/transaction_provider_test.rs
line 221 at r2 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
Done.
This does revel an issue with the structure of the enumL1ValidationStatus
. It has too many variants that act too diferently. What would happen if a new variant of status will be added? What if it is considered valid? or invalid?Added a todo (For post 0.14.0).
You don't need to test all the validation statuses, I just meant keep the tx hash and add the validation status to the assert matches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @alonh5 and @yair-starkware)
crates/starknet_batcher/src/transaction_provider_test.rs
line 221 at r2 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
You don't need to test all the validation statuses, I just meant keep the tx hash and add the validation status to the assert matches.
Discussed F2F.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! all files reviewed, all discussions resolved (waiting on @alonh5 and @yair-starkware)
The new error message prints as: