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

chore(modstate): Remove IsStopped endpoint from StateModule #2912

Merged
merged 7 commits into from
Jan 10, 2024

Conversation

Chirag018
Copy link
Contributor

@Chirag018 Chirag018 commented Nov 7, 2023

@Wondertan is this what you expected?

Closes #2906

@github-actions github-actions bot added the external Issues created by non node team members label Nov 7, 2023
remove comments
Copy link
Member

@vgonkivs vgonkivs left a comment

Choose a reason for hiding this comment

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

Hello Chirag018, thank you for your contribution. Thank you for your contribution. Unfortunately, it will break the logic of handling POST requests in the gateway. The condition if r.Method == http.MethodPost && state.IsStopped(r.Context()) disables all POST requests only if the state module was stopped when a Bad Encoding Fraud Proof is received, and the network halts.

api/gateway/middleware.go Outdated Show resolved Hide resolved
Copy link
Member

@renaynay renaynay left a comment

Choose a reason for hiding this comment

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

Looks good minus the comment left by @vgonkivs

Please also lint and let's run CI against it.

api/gateway/middleware.go Outdated Show resolved Hide resolved
@vgonkivs vgonkivs added kind:refactor Attached to refactoring PRs kind:break! Attached to breaking PRs area:state Related to fetching state and state execution and removed external Issues created by non node team members labels Nov 8, 2023
Wondertan
Wondertan previously approved these changes Nov 8, 2023
@vgonkivs
Copy link
Member

vgonkivs commented Nov 8, 2023

@Chirag018 , could you please fix lint errors?

@Chirag018
Copy link
Contributor Author

@Chirag018 , could you please fix lint errors?

yeah, will have a look on it

@Chirag018
Copy link
Contributor Author

@vgonkivs, While addressing lint issues, I identified code duplication in the state file. To resolve this, should I refactor the API.Interface struct or make other related changes?

cc: @Wondertan @renaynay

@Wondertan
Copy link
Member

@Chirag018, refactoring that struct should do the thing.

cc @distractedm1nd for confirmation

@Chirag018
Copy link
Contributor Author

OK, will wait for @distractedm1nd 's confirmation

@distractedm1nd
Copy link
Member

Yes, it needs to be removed from the API struct as well as the Module interface - don't forget to remove the implementations as well :)

That should do the trick

Copy link
Member

@renaynay renaynay left a comment

Choose a reason for hiding this comment

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

Weird, it still has the duplicate lint issue on the state file.

Maybe it needs a //nolint:dupl

not sure why it's coming up now and wasn't caught before.

@renaynay
Copy link
Member

@Chirag018 do you still want to finish up this PR? Just add //nolint:dupl to the file that's failing dupl lint

@codecov-commenter
Copy link

codecov-commenter commented Nov 29, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ade25d7) 51.29% compared to head (eb6906d) 51.29%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2912   +/-   ##
=======================================
  Coverage   51.29%   51.29%           
=======================================
  Files         177      177           
  Lines       11151    11139   -12     
=======================================
- Hits         5720     5714    -6     
+ Misses       4935     4924   -11     
- Partials      496      501    +5     

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

@ramin ramin dismissed vgonkivs’s stale review January 10, 2024 11:16

possibly resolved

@ramin ramin enabled auto-merge (squash) January 10, 2024 11:21
@ramin
Copy link
Contributor

ramin commented Jan 10, 2024

@Chirag018 can you rebase main onto here? Or at least adjust the PR so we can update the PR with base branch, then this'll merge. Thanks!

@Chirag018 Chirag018 requested a review from ramin January 10, 2024 17:01
@ramin ramin merged commit 49894c0 into celestiaorg:main Jan 10, 2024
17 of 19 checks passed
@Chirag018 Chirag018 deleted the remove-IsState-endpoint branch January 10, 2024 17:09
distractedm1nd pushed a commit that referenced this pull request Jan 10, 2024
renaynay pushed a commit to renaynay/celestia-node that referenced this pull request Jan 15, 2024
renaynay pushed a commit to renaynay/celestia-node that referenced this pull request Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:state Related to fetching state and state execution kind:break! Attached to breaking PRs kind:refactor Attached to refactoring PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

modstate: Remove IsStopped endpoint on StateModule
7 participants