nethermind icon indicating copy to clipboard operation
nethermind copied to clipboard

If cfg has Merge.Enabled = false a null ref is thrown in startup

Open ak88 opened this issue 2 years ago • 6 comments

Fixes Closes Resolves #

I did not create an issue. It is a very small bug fix.

Changes

  • List the changes

Types of changes

What types of changes does your code introduce?

  • [x] Bugfix (a non-breaking change that fixes an issue)
  • [ ] New feature (a non-breaking change that adds functionality)
  • [ ] Breaking change (a change that causes existing functionality not to work as expected)
  • [ ] Optimization
  • [ ] Refactoring
  • [ ] Documentation update
  • [ ] Build-related changes
  • [ ] Other: Description

Testing

Requires testing

  • [ ] Yes
  • [x] No

If yes, did you write tests?

  • [ ] Yes
  • [x] No

Notes on testing

Optional. Remove if not applicable.

Documentation

Requires documentation update

  • [ ] Yes
  • [x] No

If yes, link the PR to the docs update or the issue with the details labeled docs. Remove if not applicable.

Requires explanation in Release Notes

  • [ ] Yes
  • [x] No

If yes, fill in the details here. Remove if not applicable.

Remarks

Optional. Remove if not applicable.

ak88 avatar Nov 01 '23 18:11 ak88

Nice catch, but maybe if TerminalTotalDifficulty is set we should just force enable MergePlugin? @MarekM25 WDYT?

LukaszRozmej avatar Nov 02 '23 11:11 LukaszRozmej

Nice catch, but maybe if TerminalTotalDifficulty is set we should just force enable MergePlugin? @MarekM25 WDYT?

Yes, something like that. Funny - I've just written similar comment.

MarekM25 avatar Nov 02 '23 11:11 MarekM25

Nice catch, but maybe if TerminalTotalDifficulty is set we should just force enable MergePlugin? @MarekM25 WDYT?

Yes, something like that. Funny - I've just written similar comment.

@MarekM25 The Merge flag is mostly used for initializing plugins. So i guess the options are:

  • throw in cfg validation if Merge = false && TerminalTotalDifficulty != null
  • set Merge=true in cfg startup if TerminalTotalDifficulty != null
  • only check on merge flag when init CLHealthChecker

ak88 avatar Nov 03 '23 12:11 ak88

Nice catch, but maybe if TerminalTotalDifficulty is set we should just force enable MergePlugin? @MarekM25 WDYT?

Yes, something like that. Funny - I've just written similar comment.

@MarekM25 The Merge flag is mostly used for initializing plugins. So i guess the options are:

* throw in cfg validation if Merge = false && TerminalTotalDifficulty != null

* set Merge=true in cfg startup if TerminalTotalDifficulty != null

* only check on merge flag when init CLHealthChecker

I would do 1. or consider 2. @MarekM25 ?

LukaszRozmej avatar Dec 06 '23 12:12 LukaszRozmej

Nice catch, but maybe if TerminalTotalDifficulty is set we should just force enable MergePlugin? @MarekM25 WDYT?

Yes, something like that. Funny - I've just written similar comment.

@MarekM25 The Merge flag is mostly used for initializing plugins. So i guess the options are:

* throw in cfg validation if Merge = false && TerminalTotalDifficulty != null

* set Merge=true in cfg startup if TerminalTotalDifficulty != null

* only check on merge flag when init CLHealthChecker

I would do 1. or consider 2. @MarekM25 ?

IMO, both options 1 and 2 are okay.

MarekM25 avatar Dec 11 '23 09:12 MarekM25

@LukaszRozmej @MarekM25 the merge plugin willl now throw if TerminalTotalDifficulty is set and merge == false

ak88 avatar Dec 13 '23 14:12 ak88