From 2759ac26e6eaf2b246f599a519b590e29649153d Mon Sep 17 00:00:00 2001 From: IronGauntlets Date: Thu, 23 Nov 2023 11:48:19 +0000 Subject: [PATCH] Add `deployed_contracts` and `replaced_classes` to `StateDiff` To verify the state diff commitment we need to have access to all the fields present in the `StateDiff` returned by the feeder gateway. Therefore, we need to have `deployed_contract` and `replaced_classes` in the `StateDiff` messages. The reason for not including the `DeclaredV0Classes` and `DeclaredV1Classes` is because these can be derived from the `Classes` message, which all Cairo0 and Cairo1 classes can be mapped to `DeclaredV0Classes` and `DeclaredV1Classes`, respectively. --- p2p/proto/state.proto | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/p2p/proto/state.proto b/p2p/proto/state.proto index 4ed9e49..9415db6 100644 --- a/p2p/proto/state.proto +++ b/p2p/proto/state.proto @@ -18,8 +18,15 @@ message StateDiff repeated ContractStoredValue values = 4; } + message ContractAddrToClassHash { + Address contract_addr = 1; + Hash class_hash = 2; + } + uint32 domain = 1; // volition state domain repeated ContractDiff contract_diffs = 2; + repeated ContractAddrToClassHash replaced_classes = 3; + repeated ContractAddrToClassHash deployed_contracts = 4; } message EntryPoint {