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
But in the specs the ChainId is used to compute the tx hash of all the transactions. This means it should fit in a Felt meaning it should be at most a ShortString of max size 31 characters.
I recommend we store it as a Felt for its internal representation, as it will simplify its usage for tx hash computation, and implement Display on it in a way that returns the short string representation.
With the current inner repr as String and no new method to make sure the max length is respected, anybody can write code that will break the protocol.
The text was updated successfully, but these errors were encountered:
https://github.com/starkware-libs/starknet-api/blob/main/src/core.rs#L20-L21
here
ChainId
is represented as aString
But in the specs the
ChainId
is used to compute the tx hash of all the transactions. This means it should fit in aFelt
meaning it should be at most aShortString
of max size 31 characters.I recommend we store it as a
Felt
for its internal representation, as it will simplify its usage for tx hash computation, and implementDisplay
on it in a way that returns the short string representation.With the current inner repr as
String
and nonew
method to make sure the max length is respected, anybody can write code that will break the protocol.The text was updated successfully, but these errors were encountered: