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

refactor: remove a panic in process_tx_internal by refactoring validate_tx #13000

Merged
merged 2 commits into from
Feb 26, 2025

Conversation

akhi3030
Copy link
Collaborator

If we pass in the ShardLayout to validate_tx instead of the EpochId, we can simplify what it returns and then remove a panic from process_tx_internal.

@akhi3030 akhi3030 requested a review from wacban February 26, 2025 10:44
@akhi3030 akhi3030 requested a review from a team as a code owner February 26, 2025 10:44
Copy link

codecov bot commented Feb 26, 2025

Codecov Report

Attention: Patch coverage is 95.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 69.62%. Comparing base (1ce9e63) to head (2e9f3e0).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
chain/chain/src/runtime/mod.rs 93.33% 0 Missing and 1 partial ⚠️
chain/client/src/client.rs 94.73% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #13000      +/-   ##
==========================================
- Coverage   69.68%   69.62%   -0.07%     
==========================================
  Files         859      859              
  Lines      175699   175865     +166     
  Branches   175699   175865     +166     
==========================================
+ Hits       122435   122443       +8     
- Misses      48104    48262     +158     
  Partials     5160     5160              
Flag Coverage Δ
backward-compatibility 0.36% <0.00%> (+<0.01%) ⬆️
db-migration 0.36% <0.00%> (+<0.01%) ⬆️
genesis-check 1.43% <0.00%> (+<0.01%) ⬆️
linux 69.01% <95.00%> (-0.07%) ⬇️
linux-nightly 69.17% <95.00%> (-0.07%) ⬇️
pytests 1.74% <0.00%> (+<0.01%) ⬆️
sanity-checks 1.55% <0.00%> (+<0.01%) ⬆️
unittests 69.45% <95.00%> (-0.07%) ⬇️
upgradability 0.36% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@wacban wacban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

)
.expect("no storage errors")
{
if let Err(err) = self.runtime_adapter.validate_tx(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh man the old semantics of returning Some in the error case was mad. This is a great improvement!

@akhi3030 akhi3030 enabled auto-merge February 26, 2025 12:22
@akhi3030 akhi3030 added this pull request to the merge queue Feb 26, 2025
Merged via the queue into near:master with commit 3a40d70 Feb 26, 2025
29 checks passed
@akhi3030 akhi3030 deleted the rm-unnecessary-err branch February 26, 2025 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants