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

add endorsement op but only allow legacy #4314

Merged
merged 2 commits into from
Jun 27, 2024
Merged

Conversation

CoderZhi
Copy link
Collaborator

In this PR, a new field Op is introduced. OpLegacy, the default value, is for the current implementation of CandidateEndorsement action. And the others are new ops.

As it has been gated in action/protocol/staking/validations.go, only legacy actions are allowed. A follow up PR will add a hardfork to allow the new ops.

Fixes #(issue)

Type of change

Please delete options that are not relevant.

  • [] Bug fix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)
  • [] Code refactor or improvement
  • [] Breaking change (fix or feature that would cause a new or changed behavior of existing functionality)
  • [] This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [] make test
  • [] fullsync
  • [] Other test (please specify)

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • [] My code follows the style guidelines of this project
  • [] I have performed a self-review of my code
  • [] I have commented my code, particularly in hard-to-understand areas
  • [] I have made corresponding changes to the documentation
  • [] My changes generate no new warnings
  • [] I have added tests that prove my fix is effective or that my feature works
  • [] New and existing unit tests pass locally with my changes
  • [] Any dependent changes have been merged and published in downstream modules

@CoderZhi CoderZhi requested review from dustinxie, Liuhaai, envestcc and a team as code owners June 25, 2024 20:39
@CoderZhi CoderZhi force-pushed the introduce_op_in_endorsement branch from d1d8709 to ad13942 Compare June 25, 2024 20:50
Copy link

sonarcloud bot commented Jun 26, 2024

cr.bucketIndex = bucketID
cr.endorse = endorse
cr.op = CandidateEndorsementOpLegacy
return &cr, nil
Copy link
Member

Choose a reason for hiding this comment

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

see comments in 4312, better to also set method and cr.op and use common unpack code after switch

@CoderZhi CoderZhi merged commit 9e43f6e into master Jun 27, 2024
3 checks passed
@CoderZhi CoderZhi deleted the introduce_op_in_endorsement branch June 27, 2024 00:58
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