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

Panic in debug mode or non-prod chain when there is a chunk-witness validation error #11412

Merged
merged 10 commits into from
May 30, 2024

Conversation

tayfunelmas
Copy link
Contributor

@tayfunelmas tayfunelmas commented May 28, 2024

This is an attempt to create a submittable version of this commit.

After this change chunk-witness validation errors will lead to panic for non-production chains (eg. mocknet and localnet). mainnet and testnet will continue to log error and continue on validation errors.
We also add a method to enable/disable this for tests, especially for adversarial behavior where the chunk validation errors are intended as part of the test scenario.

@tayfunelmas tayfunelmas changed the title [Draft] Panic in debug mode or non-prod chain when there is a chunk-witness validation error Panic in debug mode or non-prod chain when there is a chunk-witness validation error May 29, 2024
@tayfunelmas tayfunelmas requested a review from bowenwang1996 May 29, 2024 00:56
@tayfunelmas tayfunelmas marked this pull request as ready for review May 29, 2024 00:56
@tayfunelmas tayfunelmas requested a review from a team as a code owner May 29, 2024 00:56
Copy link

codecov bot commented May 29, 2024

Codecov Report

Attention: Patch coverage is 68.75000% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 71.36%. Comparing base (2e1df80) to head (d446487).

Files Patch % Lines
...nt/src/stateless_validation/chunk_validator/mod.rs 61.53% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #11412   +/-   ##
=======================================
  Coverage   71.36%   71.36%           
=======================================
  Files         784      784           
  Lines      158108   158121   +13     
  Branches   158108   158121   +13     
=======================================
+ Hits       112837   112849   +12     
- Misses      40401    40407    +6     
+ Partials     4870     4865    -5     
Flag Coverage Δ
backward-compatibility 0.24% <0.00%> (-0.01%) ⬇️
db-migration 0.24% <0.00%> (-0.01%) ⬇️
genesis-check 1.38% <0.00%> (-0.01%) ⬇️
integration-tests 37.47% <68.75%> (+0.02%) ⬆️
linux 68.89% <38.46%> (+<0.01%) ⬆️
linux-nightly 70.81% <68.75%> (-0.01%) ⬇️
macos 52.42% <38.46%> (+<0.01%) ⬆️
pytests 1.60% <0.00%> (-0.01%) ⬇️
sanity-checks 1.39% <0.00%> (-0.01%) ⬇️
unittests 65.74% <31.25%> (+<0.01%) ⬆️
upgradability 0.28% <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
Collaborator

@bowenwang1996 bowenwang1996 left a comment

Choose a reason for hiding this comment

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

Please address my comment above but otherwise looks good

chain/client/src/client.rs Outdated Show resolved Hide resolved
@tayfunelmas tayfunelmas enabled auto-merge May 29, 2024 23:39
@tayfunelmas tayfunelmas added this pull request to the merge queue May 29, 2024
Merged via the queue into near:master with commit 4f556da May 30, 2024
27 of 29 checks passed
@tayfunelmas tayfunelmas deleted the panic-on-validation-error branch May 30, 2024 00:15
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