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

[state] validate system action layout #3838

Merged
merged 10 commits into from
Apr 14, 2023

Conversation

envestcc
Copy link
Member

Description

To avoid missing system actions in block generation, add validation of system actions when verifying received blocks.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

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

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

state/factory/workingset.go Outdated Show resolved Hide resolved
state/factory/workingset.go Outdated Show resolved Hide resolved
@@ -404,6 +404,40 @@ func (ws *workingSet) process(ctx context.Context, actions []action.SealedEnvelo
return ws.finalize()
}

func (ws *workingSet) validateSystemActionLayout(ctx context.Context, actions []action.SealedEnvelope) error {
Copy link
Member

@Liuhaai Liuhaai Apr 3, 2023

Choose a reason for hiding this comment

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

add the purpose as the comment for the func

@codecov
Copy link

codecov bot commented Apr 4, 2023

Codecov Report

Merging #3838 (dccdf90) into master (e1f0636) will increase coverage by 0.06%.
The diff coverage is 71.09%.

❗ Current head dccdf90 differs from pull request most recent head 318bab8. Consider uploading reports for the commit 318bab8 to get more accurate results

@@            Coverage Diff             @@
##           master    #3838      +/-   ##
==========================================
+ Coverage   75.38%   75.44%   +0.06%     
==========================================
  Files         303      303              
  Lines       25923    26038     +115     
==========================================
+ Hits        19541    19645     +104     
- Misses       5360     5371      +11     
  Partials     1022     1022              
Impacted Files Coverage Δ
api/web3server_marshal.go 93.21% <ø> (ø)
api/web3server_utils.go 69.20% <16.66%> (-3.67%) ⬇️
state/factory/factory.go 80.20% <33.33%> (+0.86%) ⬆️
state/factory/statedb.go 81.81% <33.33%> (+1.08%) ⬆️
api/serverV2.go 86.95% <50.00%> (ø)
state/factory/workingset.go 71.42% <68.75%> (ø)
api/web3server.go 81.41% <87.50%> (+2.74%) ⬆️
api/coreservice.go 68.09% <88.23%> (+0.74%) ⬆️
action/protocol/context.go 67.42% <100.00%> (+0.24%) ⬆️
blockchain/genesis/genesis.go 72.36% <100.00%> (ø)

... and 3 files with indirect coverage changes

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

@sonarcloud
Copy link

sonarcloud bot commented Apr 12, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

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

No Coverage information No Coverage information
13.1% 13.1% Duplication

@envestcc envestcc merged commit f21bb62 into iotexproject:master Apr 14, 2023
@envestcc envestcc deleted the system_action_check branch April 14, 2023 02:54
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.

4 participants