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

Feat/ecip1100 force enable #303

Closed
wants to merge 9 commits into from
Closed

Conversation

meowsbits
Copy link
Contributor

This is an alternative to #299. Where 299 exposes ECBP1100's auto-shutoff limits to the user as configuration options, this approach instead exposes a configuration option --ecbp1100.force=[on|off].

This is

  • simpler (from the user perspective)
  • logically (in code) more direct and forceful; rather than mutating the variables of existing conditions, the state of ECBP1100 is force-set to 1 == on and 0 == off.

Existing toggle methods are allowed to maintain their call logic, but their handler func (bc *BlockChain) EnableArtificialFinality(enable bool, logValues ...interface{}) short-circuits if the force state is active.

Hopefully this makes the fields value a little
clearer (as a status/state rather than setting).

Date: 2021-01-14 12:05:02-06:00
Signed-off-by: meows <b5c6@protonmail.com>
…n override

This provides a CLI flag --ecbp1100.nodisable which
forces the ECBP1100 logic to an always state, prevent
the auto-shutoff mechanisms (trigger on below-threshold peer count
and stale head for a time beyond a certain time window) from
disabling the ECBP1100 artificial finality logic.

Date: 2021-01-14 12:07:26-06:00
Signed-off-by: meows <b5c6@protonmail.com>
Date: 2021-01-14 12:24:55-06:00
Signed-off-by: meows <b5c6@protonmail.com>
Comments are added noting that
- the protocol manager 'safety loop' is short-circuited
  if the state is force-set, only for the reason of saving
  a noop goroutine. Note that if the override becomes
  configurable at runtime, this would need to be cut.
- min peers check is allowed to still call the EnableArtificialFunction(true/false)
  since it will be a noop either way if the override is in place.

Date: 2021-01-14 12:40:15-06:00
Signed-off-by: meows <b5c6@protonmail.com>
Date: 2021-01-14 12:53:21-06:00
Signed-off-by: meows <b5c6@protonmail.com>
Date: 2021-01-14 12:59:43-06:00
Signed-off-by: meows <b5c6@protonmail.com>
Date: 2021-01-14 12:59:55-06:00
Signed-off-by: meows <b5c6@protonmail.com>
The cost of one noop goroutine vs. potential
unexpected logic is not worth it. Would rather
call the noop and keep the AF enable/disable
logic in one place.

Date: 2021-01-14 13:06:12-06:00
Signed-off-by: meows <b5c6@protonmail.com>
Now use becomes --ecbp1100.force

where that enables forceful activation.

Date: 2021-01-15 05:19:35-06:00
Signed-off-by: meows <b5c6@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant