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

Fast reject invalid consensus params #331

Merged
merged 1 commit into from
Oct 16, 2023
Merged

Fast reject invalid consensus params #331

merged 1 commit into from
Oct 16, 2023

Conversation

philipsu522
Copy link
Contributor

@philipsu522 philipsu522 commented Oct 12, 2023

Describe your changes and provide context

Previously, a proposal to change Tendermint consensus params to an invalid value could be made, but could potentially halt the chain b/c at the block in which the proposal passes, Tendermint will verify that the params are valid and panic if the change is not valid (see https://github.com/sei-protocol/sei-tendermint/blob/d426f1fe475eb0c406296770ff5e9f8869b3887e/internal/state/execution.go#L320), thus halting the change. This PR early rejects the proposal so that the chain will no longer halt.

Testing performed to validate your change

  • Added unit tests
  • Verified on a internal chain:
root@ip-172-31-34-209:/home/ubuntu/sei-chain# seid tx gov submit-proposal param-change prop.json --from admin -b block --fees 20000usei
Enter keyring passphrase:
Error: block.MaxGas must be greater or equal to -1. Got -2
...
root@ip-172-31-34-209:/home/ubuntu/sei-chain# seid tx gov submit-proposal param-change prop.json --from admin -b block --fees 2000usei
Enter keyring passphrase:
Error: block.MaxBytes is too big. 2202009600000 > 104857600

@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Merging #331 (14d974b) into main (bf1648f) will increase coverage by 0.01%.
The diff coverage is 85.71%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #331      +/-   ##
==========================================
+ Coverage   55.40%   55.41%   +0.01%     
==========================================
  Files         620      620              
  Lines       51669    51690      +21     
==========================================
+ Hits        28625    28644      +19     
- Misses      20961    20962       +1     
- Partials     2083     2084       +1     
Files Coverage Δ
x/params/types/proposal/proposal.go 56.16% <85.71%> (+11.93%) ⬆️

... and 1 file with indirect coverage changes

Copy link
Contributor

@stevenlanders stevenlanders left a comment

Choose a reason for hiding this comment

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

lgtm

@philipsu522 philipsu522 merged commit e6817bd into main Oct 16, 2023
15 checks passed
@philipsu522 philipsu522 deleted the fast-rej-cp branch October 16, 2023 20:11
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.

3 participants