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

make empty block deterministic #1287

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

zhiqiangxu
Copy link
Contributor

The fix is straight forward, following is some compatible analysis about why it's safe to apply the fix.

VbftBlockInfo.Proposer is only ever retrieved(immutable referenced) by :

func (blk *Block) getProposer() uint32 {
	return blk.Info.Proposer
}

blk.Info is only ever mutated by:

BlockPool.setBlockSealed,Server.constructProposalMsg,Block.Deserialize:

All of them will only set blk.Info to the non-empty one.

initVbftBlock:

This is only called after a block is sealed, so doesn't affect consensus.

laizy and others added 15 commits August 5, 2020 10:25
* implement offline witness in p2p

* refactor local rpc

* add rpc api

* add license

* fix comments

* check self is gov node before vote
* remove old gov node ip from members in subnet

* fix testcase
* Drop duplicate import

* Drop redundant return and break statement

* for true ==> for

* Fix bool cmp lint

should omit comparison to bool constant

* use or drop unused variables

* Drop empty branch

* Some fmt.Sprintf is useless, drop it

* should call self.quitWg.Add(1) before starting the goroutine to avoid a race

* drop for, using append

* Update cmd/tx_cmd.go

* Update consensus/vbft/node_sync.go

Co-authored-by: laizy <[email protected]>
@laizy laizy force-pushed the master branch 2 times, most recently from 8c8ee59 to dc599e9 Compare July 6, 2021 07:08
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

5 participants