You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we have 2 ways to serialize a block: with and without logs. This is violating the toBuffer, fromBuffer API which we use all around the codebase as you now need to pass a separate param (withLogs: bool).
Originally this was setup this way because the idea was that nodes would fetch blocks without logs and then use some form of note discovery scheme to get the relevant encrypted logs. This is turning out to be an example of premature optimization and currently it's making the code ugly while it is questionable whether the non-log serving mode would ever be used and needed - end users will most likely just run a "super light client" (get archive root from Rollup contract on L1, fetch header with merkle proof from nodes, verify the merkle proof and then get the notes and note sibling paths from some note discovery service).
The objective of this task is to remove the 2 ways of serializing a block (I am of an opinion that in general when we have 2 ways of serializing an object we are most likely doing something wrong (maybe have 2 different types) and the code is turning out to be brittle (what kind of buffer have I received? with or without logs?)).
The text was updated successfully, but these errors were encountered:
Currently we have 2 ways to serialize a block: with and without logs. This is violating the toBuffer, fromBuffer API which we use all around the codebase as you now need to pass a separate param (withLogs: bool).
Originally this was setup this way because the idea was that nodes would fetch blocks without logs and then use some form of note discovery scheme to get the relevant encrypted logs. This is turning out to be an example of premature optimization and currently it's making the code ugly while it is questionable whether the non-log serving mode would ever be used and needed - end users will most likely just run a "super light client" (get archive root from Rollup contract on L1, fetch header with merkle proof from nodes, verify the merkle proof and then get the notes and note sibling paths from some note discovery service).
The objective of this task is to remove the 2 ways of serializing a block (I am of an opinion that in general when we have 2 ways of serializing an object we are most likely doing something wrong (maybe have 2 different types) and the code is turning out to be brittle (what kind of buffer have I received? with or without logs?)).
The text was updated successfully, but these errors were encountered: