Skip to content

Conversation

abi87
Copy link
Contributor

@abi87 abi87 commented Jul 27, 2023

Why this should be merged

Non-validators nodes tracking a subnet should not be required to track all primary network chains. This PR introduces a reduced mode configuration, where C-chain and X-chain are not instantiated and only P-chain is (partially) validated.

How this works

The PR introduces a reduced-mode configuration. If active:

  • C-chain and X-chain won't be instantiate
  • P-chain will be validated with the exceptions of cross chain transfers
  • Warnings will be issued if node is registered as primary network validator
  • Node will shutdown if it becomes a primary network validator. Shutdown is enforced upon restart as well
  • Chit messages will acknowledge accepted frontier instead of preferred one

How this was tested

  • CI
  • mainnet sync

@abi87 abi87 self-assigned this Jul 27, 2023
@abi87 abi87 linked an issue Jul 27, 2023 that may be closed by this pull request
@abi87 abi87 marked this pull request as ready for review July 27, 2023 08:27
@abi87 abi87 requested review from dhrubabasu and darioush July 28, 2023 10:40
@StephenButtolph StephenButtolph changed the title Reduced mode Add Primary Network Lite Sync Option Aug 3, 2023
@StephenButtolph StephenButtolph added this to the v1.10.8 milestone Aug 3, 2023
@StephenButtolph
Copy link
Contributor

state-sync prefers nodes that provide bandwidth and bootstrapping prefers validators - so I don't think this should impact bootstrapping times - even if widely adopted.

NodeID ids.NodeID // The ID of this node
NetworkID uint32 // ID of the network this node is connected to
Server server.Server // Handles HTTP API calls
LiteSyncPrimaryNetwork bool
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: put next to NetworkID

Copy link
Contributor

Choose a reason for hiding this comment

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

moved - lmk if that was where you were thinking

return "node is a primary network validator", errNoLiteSyncForValidators
})

if err := m.Health.RegisterHealthCheck("validation", liteSyncCheck, health.ApplicationTag); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: not sure validation is the right name for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like it makes sense... The check is verifying that the node is not validating

@StephenButtolph StephenButtolph added consensus This involves consensus vm This involves virtual machines networking This involves networking labels Aug 9, 2023
m.Log.Warn("node is a primary network validator",
zap.Error(errPartialSyncAsAValidator),
)
return "node is a primary network validator", errPartialSyncAsAValidator
Copy link
Contributor

Choose a reason for hiding this comment

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

I could see us removing this at some point for the reasons I shared previously.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's fine for now at least

return "node is a primary network validator", errPartialSyncAsAValidator
})

if err := m.Health.RegisterHealthCheck("validation", partialSyncCheck, health.ApplicationTag); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: "validation" -> "partial_validation"

Copy link
Contributor

Choose a reason for hiding this comment

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

hmmm I was thinking this was the "am I a primary network validator" check - not the "am I correctly configured to partially validate state"

@StephenButtolph StephenButtolph merged commit 6a8c0bd into dev Aug 9, 2023
@StephenButtolph StephenButtolph deleted the reduced_mode_validation branch August 9, 2023 23:57
@StephenButtolph StephenButtolph changed the title Add Primary Network Lite Sync Option Add Primary Network Partial Sync Option Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus This involves consensus networking This involves networking vm This involves virtual machines
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Continuous Staking
4 participants