Skip to content

Consensus recovery log#572

Merged
igormcoelho merged 6 commits intoconsensus/improved_dbftfrom
consensus/recovery_log
Jan 24, 2019
Merged

Consensus recovery log#572
igormcoelho merged 6 commits intoconsensus/improved_dbftfrom
consensus/recovery_log

Conversation

@erikzhang
Copy link
Copy Markdown
Member

No description provided.

@erikzhang erikzhang requested a review from igormcoelho January 24, 2019 10:01
@erikzhang
Copy link
Copy Markdown
Member Author

@igormcoelho Can you fix the unit tests for me?

@erikzhang erikzhang added the Critical Issues (bugs) that need to be fixed ASAP label Jan 24, 2019
@igormcoelho
Copy link
Copy Markdown
Contributor

Ok, I'll fix it Erik, it will take a couple hours. Consensus is starting automatically on every OnPersist (since it sets the Timer), so it starts without passing OnStart event... that wasnt harmful until now, but it looks like its time to put a variable isStarted on ConsensusService, to make sure timers cannot start on OnPersist. OnStart should do ISSTARTED=true and OnStop isStarted = false.
Another thing is the prefix, perhaps we should give a name to it (perhaps an Enum?) and get it from Store. So we would do: Store.Put(Store.ConsensusContextPrefix, value).

@erikzhang
Copy link
Copy Markdown
Member Author

Consensus is starting automatically on every OnPersist (since it sets the Timer), so it starts without passing OnStart event...

You are right. I have fixed it in #573, please review it.

Copy link
Copy Markdown
Contributor

@jsolman jsolman left a comment

Choose a reason for hiding this comment

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

I didn't actually run the code to test it, but from inspection it looks like there is an issue with the deserialization of the transactions.

Wrote a test and checked the code more carefully, it is fine.

@jsolman jsolman self-requested a review January 24, 2019 18:08
jsolman
jsolman previously approved these changes Jan 24, 2019
@igormcoelho igormcoelho merged commit 9aa6527 into consensus/improved_dbft Jan 24, 2019
@igormcoelho igormcoelho deleted the consensus/recovery_log branch January 24, 2019 20:55
erikzhang pushed a commit that referenced this pull request Mar 3, 2019
* Add commit phase to consensus algorithm (#534)

* Add commit phase to consensus algorithm

* fix tests

* Prevent repeated sending of `Commit` messages

* RPC call gettransactionheight (#541)

* getrawtransactionheight

Nowadays two calls are need to get a transaction height, `getrawtransaction` with `verbose` and then use the `blockhash`.
Other option is to use `confirmations`, but it can be misleading.

* Minnor fix

* Shargon's tip

* modified

* Allow to use the wallet inside a RPC plugin (#536)

* Clean code

* Clean code

* Minor fix on mempoolVerified

* Add MemoryPool Unit tests. Fix bug on initital start of Persisting the Genesis block.

* Prevent `ConsensusService` from receiving messages before starting (#573)

* Prevent `ConsensusService` from receiving messages before starting

* fixed tests - calling OnStart now

* Consensus recovery log (#572)

* Pass store to `ConsensusService`

* Implement `ISerializable` in `ConsensusContext`

* Start from recovery log

* Fix unit tests due to constructor taking the store.

* Add unit tests for serializing and deserializing the consensus context.

* Combine `ConsensusContext.ChangeView()` and `ConsensusContext.Reset()`

* Add `PreparationHash` field to `PrepareResponse` to prevent replay attacks from malicious primary (#576)

* Fixed a problem where `PrepareResponse.PreparationHash` was not assigned.

* Load context from store only when height matches

* Recover nodes requesting ChangeView when possible (#579)

* Fixes bug in `OnPrepareRequestReceived()`

* Send `RecoveryMessage` only when `message.NewViewNumber <= context.ViewNumber`

* Fix and optimize view changing (#590)

* Allow to ignore the recovery logs

* Add `isRecovering` (#594)

* Fix accepting own prepare request (#596)

* Pick some changes from #575.

* Fixes `Prefixes`

* Restore transactions from saved consensus context (#598)

* Refactoring

* AggressiveInlining (#606)

* Reset Block reference when consensus context is initialized after block persist. (#608)

* Change `ConsensusPayload` for compatibility (#609)
Thacryba pushed a commit to simplitech/neo that referenced this pull request Feb 17, 2020
* fixed broken link in docs

* fixed link anchors

* fixed broken links to getvalidators.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Critical Issues (bugs) that need to be fixed ASAP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants