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

[config] enforce correct chainID and enable IIP-13 at Quebec height #3866

Merged
merged 2 commits into from
May 26, 2023

Conversation

dustinxie
Copy link
Member

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

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

@@ -416,11 +416,6 @@ func (core *coreService) SendAction(ctx context.Context, in *iotextypes.Action)
return "", err
}

// reject web3 rewarding action if isn't activation feature
if err := core.validateWeb3Rewarding(selp); err != nil {
Copy link
Member Author

@dustinxie dustinxie May 25, 2023

Choose a reason for hiding this comment

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

no longer needed
should be removed in #3852

@@ -368,6 +364,7 @@ func makeTransferAction(t *testing.T, nonce uint64) action.SealedEnvelope {
SetGasLimit(tsf.GasLimit()).
SetGasPrice(tsf.GasPrice()).
SetNonce(nonce).
SetChainID(1).
Copy link
Member Author

@dustinxie dustinxie May 25, 2023

Choose a reason for hiding this comment

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

hash values in test change due to this

Copy link
Member

@envestcc envestcc left a comment

Choose a reason for hiding this comment

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

where does the height name Quebec come from?

@@ -148,8 +148,10 @@ func (ws *workingSet) runAction(
return nil, action.ErrGasLimit
}
// Reject execution of chainID not equal the node's chainID
if err := validateChainID(ctx, elp.ChainID()); err != nil {
return nil, err
if !action.IsSystemAction(elp) {
Copy link
Member

Choose a reason for hiding this comment

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

why is the system action not being checked?

Copy link
Member Author

Choose a reason for hiding this comment

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

system action always has chainID = 0, it would fail the check
system action is added by proposer, it cannot be replayed

@dustinxie
Copy link
Member Author

where does the height name Quebec come from?

Quebec is one of the 13 provinces of Canada

@sonarcloud
Copy link

sonarcloud bot commented May 25, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@codecov
Copy link

codecov bot commented May 25, 2023

Codecov Report

Merging #3866 (566f42e) into master (e1f0636) will increase coverage by 0.25%.
The diff coverage is 67.13%.

❗ Current head 566f42e differs from pull request most recent head 9f74452. Consider uploading reports for the commit 9f74452 to get more accurate results

@@            Coverage Diff             @@
##           master    #3866      +/-   ##
==========================================
+ Coverage   75.38%   75.64%   +0.25%     
==========================================
  Files         303      318      +15     
  Lines       25923    27139    +1216     
==========================================
+ Hits        19541    20528     +987     
- Misses       5360     5558     +198     
- Partials     1022     1053      +31     
Impacted Files Coverage Δ
action/protocol/execution/evm/evm.go 43.52% <0.00%> (-2.95%) ⬇️
action/protocol/execution/evm/evmstatedbadapter.go 66.77% <ø> (ø)
action/protocol/poll/consortium.go 0.00% <0.00%> (ø)
action/protocol/poll/staking_committee.go 43.85% <0.00%> (ø)
...tion/protocol/staking/contractstake_bucket_type.go 0.00% <0.00%> (ø)
api/web3server_marshal.go 93.21% <ø> (ø)
blockchain/config.go 74.54% <ø> (ø)
blockindex/contractstaking/dummy_indexer.go 0.00% <0.00%> (ø)
blockindex/sgd_indexer.go 0.00% <0.00%> (ø)
action/protocol/staking/contractstake_indexer.go 14.28% <14.28%> (ø)
... and 27 more

... and 4 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@dustinxie dustinxie merged commit 4a72e22 into iotexproject:master May 26, 2023
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