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

NodeID is not emitted in ValidatorManager Events #689

Open
0xJohnnyGault opened this issue Dec 20, 2024 · 3 comments
Open

NodeID is not emitted in ValidatorManager Events #689

0xJohnnyGault opened this issue Dec 20, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@0xJohnnyGault
Copy link

0xJohnnyGault commented Dec 20, 2024

In ValidatorManager.sol, NodeID is defined as bytes (a dynamically-sized type). I understand that this is probably done for future-proofing. However, when events are emitted like:

  event ValidationPeriodCreated(
    bytes32 indexed validationID,
    bytes indexed nodeID,
    bytes32 indexed registerValidationMessageID,
    uint256 weight,
    uint64 registrationExpiry
  );

Its misleading, because the actual NodeID is not emitted, as Solidity will keccak the bytes to get a 32-byte hash to put in the event. So at a minimum I would suggest renaming it to NodeIDHash which would make it clear its not the actual nodeid.

Alternatively, I think if indexed is removed, the full value would be placed in the event log.

@geoff-vball
Copy link
Contributor

The relevant discussion for this is here.

I definitely see how this isn't super user-friendly. @cam-schultz would it make sense to use a bytes32 for all sizes? I think the bytes20 should just get padded?

@cam-schultz
Copy link
Contributor

I still think that bytes is the most future-proofed option, as it's the most in line with the ACP-77 spec. Removing indexed (and indexing one of the other fixed size parameters instead) sounds like a reasonable workaround to me. The other suggestion to rename to NodeIDHash would clarify the output value, but wouldn't do much to make the event more useful.

@0xJohnnyGault
Copy link
Author

Having the actual nodeID available in the log would be very useful, so I would vote for removing the indexed attr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog 🗄️
Development

No branches or pull requests

3 participants