@@ -12,7 +12,6 @@ import (
1212 storetypes "cosmossdk.io/store/types"
1313
1414 "github.com/cosmos/cosmos-sdk/codec"
15- sdk "github.com/cosmos/cosmos-sdk/types"
1615
1716 clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types"
1817 host "github.com/cosmos/ibc-go/v10/modules/core/24-host"
@@ -73,12 +72,9 @@ func (cs ClientState) Validate() error {
7372
7473// verifyMembership is a generic proof verification method which verifies a proof of the existence of a value at a given CommitmentPath at the specified height.
7574func (cs * ClientState ) verifyMembership (
76- ctx sdk.Context ,
7775 clientStore storetypes.KVStore ,
7876 cdc codec.BinaryCodec ,
7977 height exported.Height ,
80- delayTimePeriod uint64 ,
81- delayBlockPeriod uint64 ,
8278 proof []byte ,
8379 path exported.Path ,
8480 value []byte ,
@@ -87,10 +83,6 @@ func (cs *ClientState) verifyMembership(
8783 return ErrClientFrozen
8884 }
8985
90- if err := verifyDelayPeriodPassed (ctx , clientStore , height , delayTimePeriod , delayBlockPeriod ); err != nil {
91- return err
92- }
93-
9486 if path == nil || path .Empty () {
9587 return errorsmod .Wrap (ErrInvalidPath , "path cannot be empty" )
9688 }
@@ -179,39 +171,3 @@ func setClientState(store storetypes.KVStore, cdc codec.BinaryCodec, clientState
179171 bz := clienttypes .MustMarshalClientState (cdc , clientState )
180172 store .Set (host .ClientStateKey (), bz )
181173}
182-
183- // verifyDelayPeriodPassed will ensure that at least delayTimePeriod amount of time and delayBlockPeriod number of blocks have passed
184- // since consensus state was submitted before allowing verification to continue.
185- func verifyDelayPeriodPassed (ctx sdk.Context , store storetypes.KVStore , proofHeight exported.Height , delayTimePeriod , delayBlockPeriod uint64 ) error {
186- if delayTimePeriod != 0 {
187- processedTime , ok := getProcessedTime (store , proofHeight )
188- if ! ok {
189- return errorsmod .Wrapf (ErrProcessedTimeNotFound , "processed time not found for height: %s" , proofHeight )
190- }
191-
192- currentTimestamp := uint64 (ctx .BlockTime ().UnixNano ())
193- validTime := processedTime + delayTimePeriod
194-
195- if currentTimestamp < validTime {
196- return errorsmod .Wrapf (ErrDelayPeriodNotPassed , "cannot verify packet until time: %d, current time: %d" ,
197- validTime , currentTimestamp )
198- }
199- }
200-
201- if delayBlockPeriod != 0 {
202- processedHeight , ok := getProcessedHeight (store , proofHeight )
203- if ! ok {
204- return errorsmod .Wrapf (ErrProcessedHeightNotFound , "processed height not found for height: %s" , proofHeight )
205- }
206-
207- currentHeight := clienttypes .GetSelfHeight (ctx )
208- validHeight := clienttypes .NewHeight (processedHeight .GetRevisionNumber (), processedHeight .GetRevisionHeight ()+ delayBlockPeriod )
209-
210- if currentHeight .LT (validHeight ) {
211- return errorsmod .Wrapf (ErrDelayPeriodNotPassed , "cannot verify packet until height: %s, current height: %s" ,
212- validHeight , currentHeight )
213- }
214- }
215-
216- return nil
217- }
0 commit comments