neo-modules icon indicating copy to clipboard operation
neo-modules copied to clipboard

Different Magic attribute value than to Network leads to errors when starting consensus

Open gsmachado opened this issue 5 years ago • 4 comments

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):

image

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):

image

Platform:

  • neo-node on commit a636e8b
  • neo-modules on commit b54fb54
  • but, both pointing to 3.0.0-CI01238

gsmachado avatar Mar 10 '21 23:03 gsmachado

@superboyiii @cloud8little can you or someone else check this one?

gsmachado avatar Mar 15 '21 13:03 gsmachado

@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.

cloud8little avatar Mar 15 '21 13:03 cloud8little

So, the Magic and Network attributes SHOULD be the same?

If yes:

  • Why do they have different names?
  • Why Magic attribute is not extinguished and only Network is used?

If no:

  • Why a different Magic and Network attributes affect neo-node functionality?

gsmachado avatar Mar 15 '21 13:03 gsmachado

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".

ixje avatar May 04 '21 06:05 ixje