Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for removing node IDs in the EVN module by extending configuration options and updating node ID management logic in the Ethereum backend and StakeHub contract interaction.
- Updates configuration marshalling/unmarshalling to use EVNNodeIDsToAdd and EVNNodeIDsToRemove.
- Refactors node ID registration into separate handling of removals and additions with improved deduplication logic.
- Introduces a new RemoveNodeIDs function in the Parlia engine to create signed transactions for node ID removal.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| eth/ethconfig/gen_config.go | Renames the configuration field and adds support for node ID removal. |
| eth/ethconfig/config.go | Updates config structure with new EVN node ID add/remove options. |
| eth/backend.go | Refactors the node ID registration to incorporate removals and additions with deduplication logic. |
| consensus/parlia/stakehub.go | Implements the RemoveNodeIDs function for creating node ID removal transactions. |
Comments suppressed due to low confidence (1)
eth/backend.go:560
- [nitpick] The function 'registerNodeID' now handles both additions and removals; consider renaming it (e.g., to 'updateNodeIDs') to better reflect its dual responsibility.
func (s *Ethereum) registerNodeID(parlia *parlia.Parlia) error {
| isRegistered = true | ||
| break | ||
| // Handle wildcard removal | ||
| if len(s.config.EVNNodeIDsToRemove) == 1 { |
There was a problem hiding this comment.
Does removal need to check the registeredSet? It may avoid a repeat removal operation.
There was a problem hiding this comment.
you mean get once this account can remove and check against that ?
There was a problem hiding this comment.
After the nodeIDs have been removed, they may be removed again when the BSC is restarted next time. If here check the registeredSet from on-chain, it may avoid this repeat removal operation.
There was a problem hiding this comment.
It's not a bug, if you agree, you could optimize it next time.
Add support for node ID removal in EVN
Description
This PR adds support for removing node IDs from the StakeHub contract, complementing the existing node ID registration functionality. The changes include both the contract interaction layer and the configuration management.
Changes
Added
RemoveNodeIDsfunction to Parlia consensus engineRefactored node ID management in Ethereum backend
registerNodeIDintohandleRemovalsandhandleAdditionsUpdated configuration
ValidatorNodeIDsToAddtoEVNNodeIDsToAddfor consistencyEVNNodeIDsToRemoveconfiguration optionTechnical Details
#3071