hyperledger-labs / yui-fabric-ibc

IBC implementation in Hyperledger Fabric
Other
35 stars 9 forks source link

Use deterministic timestamp in sdk.Context #37

Closed bluele closed 2 years ago

bluele commented 2 years ago

Currently, we use tmtime.Now() as the current timestamp in BaseApp, but the timestamp is different between the endorsers.

I propose to use stub.GetTxTimestamp instead, which is guaranteed to be within a range of ±Δ seconds for each endorser's local time.

bluele commented 2 years ago

I realized that we need to use sequence.timestamp as ctx.BlockTime considering Packet Timeout in IBC. If we use a clock that is different from consensusState.timestamp, it could cause an inconsistency such as both TimeoutPacket on src and RecvPacket on dst to succeed.