ENR API and types are error prone since it handles both mutable and immutable ENRs, and mixing these behaviors makes the types lax and adds confusing behavior. Eg: encode takes an optional private key. Encoding can fail if the ENR has been mutated and not resigned. Etc.
A better design would prevent error cases that currently have to be handled.
ENR API and types are error prone since it handles both mutable and immutable ENRs, and mixing these behaviors makes the types lax and adds confusing behavior. Eg:
encode
takes an optional private key. Encoding can fail if the ENR has been mutated and not resigned. Etc.A better design would prevent error cases that currently have to be handled.
eg: