Different Magic attribute value than to Network leads to errors when starting consensus
Describe the bug
When there's a mismatch of Magic and Network attributes, the consensus can't start.
Probably this is intended. In this case, however, better error messages should be provided.
Or, if this is not intended, can Magic be set to a value and Network to another one (in all Plugins of neo-modules)?
Another thing, is: Magic attribute in the ProtocolConfiguration is still necessary with the introduction of Network? If yes, for which use cases?
To Reproduce
If Magic is set to 769 in the ProtocolConfiguration but all other Network attributes are set to 5195086 (in all plugins):

If Magic is set to 5195086 in the ProtocolConfiguration but the wallet is not re-generated (i.e., wallet.json was generated still with 769):

Platform:
-
neo-nodeon commita636e8b -
neo-moduleson commitb54fb54 - but, both pointing to
3.0.0-CI01238
@superboyiii @cloud8little can you or someone else check this one?
@superboyiii @cloud8little can you or someone else check this one?
When there's a mismatch of Magic and Network attributes, the consensus can't start.
Yes, it is intended, when the network id mismatch, the plugin won't work. for all plugins, the same.
Different network configuration is used to connect to different Neo instance. It will used for NEOFs network in later design.
So, the Magic and Network attributes SHOULD be the same?
If yes:
- Why do they have different names?
- Why
Magicattribute is not extinguished and onlyNetworkis used?
If no:
- Why a different
MagicandNetworkattributes affect neo-node functionality?
I recently ran into this again, I think there should be a more friendly error message when the magic/network versions mismatch than "Object reference not set to an instance of of an object".