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
When dynamic types like bytes are included in a log, it makes the length of the log data not a multiple of 32. For example, this is a log data for Lock(bytes to, uint64 amount, address token)(line break for every 32 bytes == 1 word).
The first word contains the relative position of the first element(hex 60 == dec 96). The word in that position contains the length of the bytes. The 3-byte data 686868 follows it.
It makes the parse_log in ethabi package not works. (ethabi/src/util.rs line 7-9)
if data.len() % 32 != 0 {
return Err(ErrorKind::InvalidData.into());
}
To solve this problem, we have to change every bytes in solidity files into bytes32. On the frontend side, we can either 1. hash the input data to make it bytes32 or 2. accept bytes only whose length is less than 32.
Bootstrapping process design
In this patch I outline a detailed and I think workable bootstrapping
process that can start Peggy in a decentralized manner without creating
too much manual consensus burden.
When dynamic types like
bytes
are included in a log, it makes the length of the logdata
not a multiple of 32. For example, this is a log data forLock(bytes to, uint64 amount, address token)
(line break for every 32 bytes == 1 word).The first word contains the relative position of the first element(hex 60 == dec 96). The word in that position contains the length of the
bytes
. The 3-byte data686868
follows it.It makes the
parse_log
in ethabi package not works. (ethabi/src/util.rs line 7-9)To solve this problem, we have to change every
bytes
in solidity files intobytes32
. On the frontend side, we can either 1. hash the input data to make it bytes32 or 2. accept bytes only whose length is less than 32.So the api should be modified as:
unlock
also has to take bytes32 in favor of #32The text was updated successfully, but these errors were encountered: