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

Fix hash calculation for proposal for go-ibft's update #1065

Merged
merged 25 commits into from
Jan 31, 2023

Conversation

Kourin1996
Copy link
Contributor

Description

As described in 0xPolygon/go-ibft#55, hash calculation needs to update for IBFT2.0 consensus.
In particular, IBFT backend must generate hash for IBFT consensus from tuple of (EthereumBlock, round).

This PR changes hash calculation add adds new field for round in IBFT Extra.

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Breaking changes

Please complete this section if any breaking changes have been made, otherwise delete it

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

Manual tests

Please complete this section if you ran manual tests for this functionality, otherwise delete it

Documentation update

Please link the documentation update PR in this section if it's present, otherwise delete it

Additional comments

Please post additional comments in this section if you have them, otherwise delete it

@Kourin1996 Kourin1996 added the bug fix Functionality that fixes a bug label Dec 21, 2022
@Kourin1996 Kourin1996 self-assigned this Dec 21, 2022
@Kourin1996 Kourin1996 changed the title [PoC] Fix hash calculation for proposal for go-ibft's update Fix hash calculation for proposal for go-ibft's update Dec 28, 2022
@Kourin1996 Kourin1996 marked this pull request as ready for review December 28, 2022 18:19
@0xPolygon 0xPolygon deleted a comment from CLAassistant Jan 9, 2023
consensus/ibft/verifier.go Outdated Show resolved Hide resolved
@Stefan-Ethernal
Copy link
Collaborator

Does it make sense to address these errors before the review process?

Error: consensus/ibft/messages.go:27:30: undefined: proto.ProposedBlock
Error: consensus/ibft/messages.go:93:22: undefined: proto.ProposedBlock
Error: consensus/ibft/verifier.go:185:63: undefined: proto.ProposedBlock
Error: consensus/ibft/ibft.go:199:3: cannot use i (variable of type *backendIBFT) as type core.Backend in argument to newIBFT:

@Kourin1996
Copy link
Contributor Author

Does it make sense to address these errors before the review process?

Need a release in go-ibft side because this PR includes a change based on a open PR in go-ibft
0xPolygon/go-ibft#55

consensus/ibft/signer/extra.go Outdated Show resolved Hide resolved
consensus/ibft/signer/extra.go Outdated Show resolved Hide resolved
@laviniat1996 laviniat1996 linked an issue Jan 30, 2023 that may be closed by this pull request
Copy link
Collaborator

@Stefan-Ethernal Stefan-Ethernal left a comment

Choose a reason for hiding this comment

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

LGTM

consensus/ibft/signer/extra.go Outdated Show resolved Hide resolved
consensus/ibft/signer/extra.go Outdated Show resolved Hide resolved
consensus/ibft/signer/extra.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jan 30, 2023

Codecov Report

Merging #1065 (63f4cc0) into develop (0a9d09b) will increase coverage by 0.23%.
The diff coverage is 28.18%.

@@             Coverage Diff             @@
##           develop    #1065      +/-   ##
===========================================
+ Coverage    53.85%   54.09%   +0.23%     
===========================================
  Files          132      132              
  Lines        17596    17704     +108     
===========================================
+ Hits          9477     9577     +100     
- Misses        7473     7490      +17     
+ Partials       646      637       -9     
Impacted Files Coverage Δ
consensus/ibft/consensus_backend.go 5.24% <0.00%> (-0.13%) ⬇️
consensus/ibft/ibft.go 1.46% <0.00%> (-0.11%) ⬇️
consensus/ibft/messages.go 0.00% <0.00%> (ø)
consensus/ibft/verifier.go 0.00% <0.00%> (ø)
consensus/ibft/signer/extra.go 73.77% <66.03%> (-3.33%) ⬇️
consensus/ibft/signer/signer.go 94.21% <100.00%> (+1.31%) ⬆️
consensus/ibft/signer/helper.go 96.25% <0.00%> (-3.75%) ⬇️
state/runtime/tracer/structtracer/tracer.go 99.03% <0.00%> (-0.97%) ⬇️
txpool/account.go 94.73% <0.00%> (-0.14%) ⬇️
state/runtime/evm/state.go 73.50% <0.00%> (-0.10%) ⬇️
... and 6 more

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

@Kourin1996 Kourin1996 merged commit 9e25218 into develop Jan 31, 2023
@Kourin1996 Kourin1996 deleted the hotfix/EVM-279 branch January 31, 2023 08:22
@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fix Functionality that fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade go-ibft package version to 0.1.0
7 participants