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

feat(fraud): add "skip validation height" flag #1294

Merged
merged 5 commits into from
Dec 24, 2024

Conversation

srene
Copy link
Contributor

@srene srene commented Dec 23, 2024

PR Standards

Opening a pull request should be able to meet the following requirements

--

PR naming convention: https://hackmd.io/@nZpxHZ0CT7O5ngTp0TP9mg/HJP_jrm7A


Close #XXX

<-- Briefly describe the content of this pull request -->

For Author:

  • Targeted PR against correct branch
  • included the correct type prefix in the PR title
  • Linked to Github issue with discussion and accepted design
  • Targets only one github issue
  • Wrote unit and integration tests
  • All CI checks have passed
  • Added relevant godoc comments

For Reviewer:

  • confirmed the correct type prefix in the PR title
  • Reviewers assigned
  • confirmed all author checklist items have been addressed

After reviewer approval:

  • In case targets main branch, PR should be squashed and merged.
  • In case PR targets a release branch, PR should be rebased.

@srene srene requested a review from a team as a code owner December 23, 2024 17:30
block/block.go Outdated
m.blockCache.Delete(block.Header.Height)
// TODO: can we take an action here such as dropping the peer / reducing their reputation?
return fmt.Errorf("block not valid at height %d, dropping it: err:%w", block.Header.Height, err)
if m.Conf.SkipValidationHeight == block.Header.Height {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if m.Conf.SkipValidationHeight == block.Header.Height {
if m.Conf.SkipValidationHeight != block.Header.Height {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

uups. fixed

@@ -51,6 +51,7 @@ message State {

int64 revision_start_height = 21;

uint32 prev_drs = 23;
Copy link
Contributor

Choose a reason for hiding this comment

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

what is this for ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nothing, it was from previous test. removed

types/state.go Outdated
@@ -45,6 +45,8 @@ type State struct {

// LastHeaderHash is the hash of the last block header.
LastHeaderHash [32]byte

PrevDrs uint32
Copy link
Contributor

Choose a reason for hiding this comment

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

remove here as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@omritoptix omritoptix changed the title feat(fraud): skip validation height feat(fraud): add "skip validation height" flag Dec 23, 2024
@srene srene linked an issue Dec 24, 2024 that may be closed by this pull request
@omritoptix omritoptix merged commit 1dfee6a into main Dec 24, 2024
4 checks passed
@omritoptix omritoptix deleted the srene/skip-validation-heigth branch December 24, 2024 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fail to validate new dymint header when upgrade
4 participants