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
During syncing from the feeder gateway we store the interim storage_commitment and class_commitment fields in the block header. These values are not taken from the feeder gateway response but are the root commitment for the storage and classes Merkle trees respectively. The state_commitment (also present in the block header from the feeder gateway) is then calculated from these two commitments. Both storage and class commitments are stored in the block_headers table in our storage.
Our state diff batching changes in P2P checkpoint sync can't properly calculate these values because that would require calculating the root commitment of the Merkle trees for each block -- which is exactly we'd like to avoid by using batching.
It turns out that there are only very few places where we actually use these values:
The pathfinder_subscribe JSON-RPC method that returns these fields for new headers. There are no known users to this API, so this is something we can probably just remove / break having provided an equivalent standards-compliant interface in JSON-RPC 0.8.0.
The state revert code used during reorgs: both the storage and class commitments are used as safeguards. After updating and committing the respective Merkle tree the commitment value from the revert target is used to double-check that we have the correct state. We could just as well use the state_commitment instead to check the resulting state: the only thing we're losing is the granularity of the check (we won't be able to differentiate between a storage commitment mismatch and a class commitment mismatch).
Ideally we should remove both fields from our codebase and storage.
The text was updated successfully, but these errors were encountered:
During syncing from the feeder gateway we store the interim
storage_commitment
andclass_commitment
fields in the block header. These values are not taken from the feeder gateway response but are the root commitment for the storage and classes Merkle trees respectively. Thestate_commitment
(also present in the block header from the feeder gateway) is then calculated from these two commitments. Both storage and class commitments are stored in theblock_headers
table in our storage.Our state diff batching changes in P2P checkpoint sync can't properly calculate these values because that would require calculating the root commitment of the Merkle trees for each block -- which is exactly we'd like to avoid by using batching.
It turns out that there are only very few places where we actually use these values:
pathfinder_subscribe
JSON-RPC method that returns these fields for new headers. There are no known users to this API, so this is something we can probably just remove / break having provided an equivalent standards-compliant interface in JSON-RPC 0.8.0.state_commitment
instead to check the resulting state: the only thing we're losing is the granularity of the check (we won't be able to differentiate between a storage commitment mismatch and a class commitment mismatch).Ideally we should remove both fields from our codebase and storage.
The text was updated successfully, but these errors were encountered: