Skip to content

LO2302 support timeout #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
766d89a
add service test mock
Mar 10, 2025
1be4141
add service_test
Mar 13, 2025
49d4677
restore wrongly removed lines
Mar 14, 2025
422f365
impl timeout
Mar 17, 2025
7bf6aa8
rebased
Mar 17, 2025
537903a
add test for timeout
Mar 17, 2025
15237ab
sort timeout packet in relay cmd
Mar 18, 2025
078526c
use absense proof for timeout
Mar 24, 2025
645fea4
fix proof of ordered timeout
Mar 25, 2025
e3fe411
set NextSequenceRecv of TimeoutPacket not zero in unordered channel
Mar 28, 2025
ea416cd
rename testmock.go to _test.go
Mar 31, 2025
e6a5d34
support case of timeout at latest but not at finalized
Mar 31, 2025
d859d06
refactoring. rename Sort to Process or Timeout
Mar 31, 2025
287de42
update ibc-mock-client
Apr 14, 2025
ea0f74a
add generated mock_chain_test.go
May 8, 2025
2265e8f
Update core/types.go
dai1975 May 8, 2025
75070a0
Update core/naive-strategy.go
dai1975 May 8, 2025
08524bb
refactoring
May 19, 2025
d57fef5
improve code consistency
May 21, 2025
b62e0b2
fix
May 21, 2025
a02d1fb
Update core/naive-strategy.go
dai1975 May 21, 2025
f7ec4c1
udpate telemetry change
Jun 5, 2025
9df4408
multiple timeout packets are relay backed in unordered channel
Jun 9, 2025
a400a40
add test
Jun 9, 2025
16ce7fb
unique error message
Jun 9, 2025
ebb1c51
fixed
Jun 9, 2025
32deede
use type switch statement
Jun 10, 2025
3e0b45b
change file scoped fields be unexported
Jun 10, 2025
239f5fd
add tests of both sides have messages
Jun 11, 2025
0583532
use packets's sequence as commitment key in ordered channel
Jun 11, 2025
122c796
go fmt
Jun 11, 2025
2190362
check preceding packet before timeout packet is finally received in o…
Jun 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ protoImage=$(DOCKER) run --user 0 --rm -v $(CURDIR):/workspace --workdir /worksp
build:
go build -o ./build/yrly .

TESTMOCKS = core/mock_chain_test.go
.PHONY: test
test:
test: $(TESTMOCKS)
go test -v ./...

proto-gen:
Expand All @@ -20,4 +21,11 @@ proto-update-deps:
@echo "Updating Protobuf dependencies"
$(DOCKER) run --user 0 --rm -v $(CURDIR)/proto:/workspace --workdir /workspace $(protoImageName) buf mod update

.PHONY: proto-gen proto-update-deps
$(TESTMOCKS):
go generate ./...

pre-commit:
go mod tidy
go fmt ./...

.PHONY: proto-gen proto-update-deps pre-commit
13 changes: 13 additions & 0 deletions chains/tendermint/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,19 @@ func (c *Chain) queryChannel(ctx context.Context, height int64, prove bool) (cha
return res, nil
}

// QueryNextSequenceReceive returns a info about nextSequence
func (c *Chain) QueryNextSequenceReceive(ctx core.QueryContext) (res *chantypes.QueryNextSequenceReceiveResponse, err error) {
return c.queryNextSequenceReceive(ctx.Context(), int64(ctx.Height().GetRevisionHeight()), false)
}

func (c *Chain) queryNextSequenceReceive(ctx context.Context, height int64, prove bool) (chanRes *chantypes.QueryNextSequenceReceiveResponse, err error) {
res, err := chanutils.QueryNextSequenceReceive(c.CLIContext(height).WithCmdContext(ctx), c.PathEnd.PortID, c.PathEnd.ChannelID, prove)
if err != nil {
return nil, err
}
return res, nil
}

// QueryClientConsensusState retrieves the latest consensus state for a client in state at a given height
func (c *Chain) QueryClientConsensusState(
ctx core.QueryContext, dstClientConsHeight ibcexported.Height) (*clienttypes.QueryConsensusStateResponse, error) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/config.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package cmd

import (
"encoding/json"
"fmt"
"os"
"encoding/json"

"github.com/hyperledger-labs/yui-relayer/config"
"github.com/spf13/cobra"
Expand Down
5 changes: 5 additions & 0 deletions cmd/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,11 @@ func relayMsgsCmd(ctx *config.Context) *cobra.Command {
return err
}

err = st.ProcessTimeoutPackets(cmd.Context(), c[src], c[dst], sh, sp) // update sp
if err != nil {
return err
}

msgs := core.NewRelayMsgs()

doExecuteRelaySrc := len(sp.Dst) > 0
Expand Down
5 changes: 5 additions & 0 deletions core/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
)

// Chain represents a chain that supports sending transactions and querying the state
//
//go:generate mockgen -source=chain.go -destination=mock_chain_test.go -package core
type Chain interface {
// GetAddress returns the address of relayer
GetAddress() (sdk.AccAddress, error)
Expand Down Expand Up @@ -106,6 +108,9 @@ type ICS04Querier interface {
// QueryChannel returns the channel associated with a channelID
QueryChannel(ctx QueryContext) (chanRes *chantypes.QueryChannelResponse, err error)

// QueryNextSequenceReceive returns a info about nextSequence
QueryNextSequenceReceive(ctx QueryContext) (res *chantypes.QueryNextSequenceReceiveResponse, err error)

// QueryUnreceivedPackets returns a list of unrelayed packet commitments
QueryUnreceivedPackets(ctx QueryContext, seqs []uint64) ([]uint64, error)

Expand Down
Loading
Loading