zeta-chain/node

feat(protos): About protobuf structure design

Closed this issue · 2 comments

Is your feature request related to a problem? Please describe.
protobuf file: proto/zetachain/zetacore/pkg/proofs/ethereum/ethereum.proto
Replace the array representation method with map.
Put/Delete/Has/Get Looks more suitable for map operation. Arrays is not a efficient structure

Describe the solution you'd like

message Proof {
  repeated bytes keys = 1;
  repeated bytes values = 2;
}

map

message Proof {
     map<bytes, bytes> proofs = 1; // key -> value
}

Describe alternatives you've considered
Null

Motivation and Context
Protobuf optimization

It is generally advised not using maps in Cosmos SDK modules as iteration is not deterministic and can lead to consensus failiure.

It is generally advised not using maps in Cosmos SDK modules as iteration is not deterministic and can lead to consensus failiure.

Cool