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

process blocks #5681

Merged
merged 9 commits into from Nov 7, 2023
Merged

Conversation

miiu96
Copy link
Contributor

@miiu96 miiu96 commented Nov 1, 2023

Reasoning behind the pull request

  • Process blocks

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

# Conflicts:
#	node/chainSimulator/chainSimulator.go
#	node/chainSimulator/components/testOnlyProcessingNode.go
#	node/chainSimulator/interface.go
@miiu96 miiu96 marked this pull request as ready for review November 7, 2023 12:34
Base automatically changed from create-configs to feat/test-only-processor-node November 7, 2023 12:41
Copy link

codecov bot commented Nov 7, 2023

Codecov Report

Attention: 46 lines in your changes are missing coverage. Please review.

Comparison is base (3488789) 79.26% compared to head (a0dd10a) 79.26%.
Report is 1 commits behind head on feat/test-only-processor-node.

❗ Current head a0dd10a differs from pull request most recent head 8a5fa28. Consider uploading reports for the commit 8a5fa28 to get more accurate results

Additional details and impacted files
@@                      Coverage Diff                       @@
##           feat/test-only-processor-node    #5681   +/-   ##
==============================================================
  Coverage                          79.26%   79.26%           
==============================================================
  Files                                724      724           
  Lines                              95190    95210   +20     
==============================================================
+ Hits                               75452    75471   +19     
+ Misses                             14386    14385    -1     
- Partials                            5352     5354    +2     
Files Coverage Δ
node/chainSimulator/components/storageService.go 100.00% <100.00%> (ø)
node/chainSimulator/chainSimulator.go 75.00% <70.00%> (-0.48%) ⬇️
node/chainSimulator/configs/configs.go 0.00% <0.00%> (ø)
...hainSimulator/components/testOnlyProcessingNode.go 6.84% <0.00%> (+0.40%) ⬆️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -151,11 +151,6 @@ func NewTestOnlyProcessingNode(args ArgsTestOnlyProcessingNode) (*testOnlyProces
if err != nil {
return nil, err
}
err = instance.createTransactionLogProcessor()
Copy link
Contributor

Choose a reason for hiding this comment

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

We need the tx logs processor. Please put back the code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the logs processor is created inside the process components.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

blsKeyBytes []byte
}

func NewBlocksCreator(nodeHandler NodeHandler, blsKeyBytes []byte) (*blocksCreator, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

missing comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

currentHeader := creator.nodeHandler.GetChainHandler().GetCurrentBlockHeader()
var nonce, round uint64
var prevHash, prevRandSeed []byte
if currentHeader != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

please extract in a function L23 - L34

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

return err
}

err = newHeader.SetChainID([]byte("chain"))
Copy link
Contributor

Choose a reason for hiding this comment

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

"chain" should be a const and used also in node/chainSimulator/configs/configs.go L51

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

iulianpascalau
iulianpascalau previously approved these changes Nov 7, 2023
nonce, round = currentHeader.GetNonce(), currentHeader.GetRound()
prevHash = creator.nodeHandler.GetChainHandler().GetCurrentBlockHeaderHash()
prevRandSeed = currentHeader.GetRandSeed()
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

could have omitted the "else" branch and return on L101

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

@ssd04 ssd04 self-requested a review November 7, 2023 14:16
@miiu96 miiu96 self-assigned this Nov 7, 2023
}, nil
}

// CreateNewBlock create and process a new block
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
// CreateNewBlock create and process a new block
// CreateNewBlock creates and process a new block

?

Copy link
Contributor

Choose a reason for hiding this comment

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

fixing in the next PR

@iulianpascalau iulianpascalau merged commit 193e88b into feat/test-only-processor-node Nov 7, 2023
5 checks passed
@iulianpascalau iulianpascalau deleted the process-blocks branch November 7, 2023 15:14
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.

None yet

3 participants