Skip to content

Load hashes before Mempool feature initializes#824

Merged
quantumagi merged 1 commit intostratisproject:release/1.2.0.0from
quantumagi:loadhashesearly
Dec 23, 2021
Merged

Load hashes before Mempool feature initializes#824
quantumagi merged 1 commit intostratisproject:release/1.2.0.0from
quantumagi:loadhashesearly

Conversation

@quantumagi
Copy link
Contributor

@quantumagi quantumagi commented Dec 20, 2021

@noescape00
Copy link
Contributor

@quantumagi have you tried to fill mempool, shutdown and start? Did it fix the problem?

@quantumagi
Copy link
Contributor Author

quantumagi commented Dec 21, 2021

The purpose of this PR is to fix the null value exception seen in the stack trace accompanying the ClickUp task.

Inspecting the trace revealed that private List<uint256> whitelistedHashes was null when the mempool's InitializeAsync was being called.

By tracing the code I established that the PoAFeature.InitializeAsync, which initializes that value, is only called after the mempool's initialize. This was identified as the root cause of the exception.

Setting the whitelistedHashes value to non-null before the mempool is initialized would 100% avoid the exception. This could be done by setting the value earlier, in the constructor, instead of the InitializeAsync method.

After implementing the fix I performed unit testing by once again stepping through and debugging the code. I confirmed that the value was now non-null when the mempool's InitializeAsync was being called.

@quantumagi have you tried to fill mempool, shutdown and start? Did it fix the problem?

@noescape00, I've left additional testing to the integration testing phase. We won't see this null error again though.

@quantumagi quantumagi merged commit 927fd62 into stratisproject:release/1.2.0.0 Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants