Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
e0b67a0
debug sleep in MakeHeadersStream
Jun 24, 2025
6416e29
add debug waiting while SetupHeadersForUpdate in mock prover
Jul 3, 2025
239ba4d
first impl to resolve a 128-block problem in create-client
Jul 3, 2025
b67f239
remove comment outed code
Jul 3, 2025
23bb8f0
make settledConnetion run in parallel and hostConsProof run in serial
Jul 5, 2025
d2f4669
fix
Jul 5, 2025
3f1426d
remove debug print
Jul 5, 2025
98cfbd1
remove debug copy code
Jul 5, 2025
bca17c7
fix
Jul 5, 2025
71a4e32
go fmt
Jul 5, 2025
0bc5702
fix review
Jul 23, 2025
6977a18
fix channel handshake
Jul 23, 2025
28ca980
refactoring
Jul 27, 2025
e945a65
go fmt
Jul 30, 2025
5702df4
refactoring log
Jul 31, 2025
3238a99
support testing lost old state on blockchain node
Jul 31, 2025
66d1019
go fmt
Jul 31, 2025
a69be9a
tiny fix
Jul 31, 2025
638267b
support casting to debugprover
Jul 31, 2025
516f0b3
change env var name
Jul 31, 2025
efbc46d
go fmt
Jul 31, 2025
d5c495e
fix debug tendermint query
Jul 31, 2025
238e0ba
fix
Jul 31, 2025
e9ffe15
fix
Jul 31, 2025
398090c
re-run CI test
Jul 31, 2025
5f02390
fix comment
Jul 31, 2025
8ea0ede
fix comment
Jul 31, 2025
12e90c8
add debug chain module
Aug 6, 2025
85a8e6b
fix review
Aug 6, 2025
94f329d
fix review
Aug 6, 2025
5221194
minimize diffs
Aug 6, 2025
226b6df
go fmt
Aug 6, 2025
1a7bc68
review
Aug 6, 2025
eb3bc52
review
Aug 6, 2025
4ab4c7c
review
Aug 6, 2025
cd591e6
fix
Aug 6, 2025
5a72783
Update provers/debug/prover.go
dai1975 Aug 6, 2025
98ce494
fix comment
Aug 6, 2025
bdb8665
fix review
Aug 12, 2025
7e0e9e9
keep parralel original SHFU in debug SHFU
Aug 13, 2025
bf3c3a2
Merge pull request #169 from dai1975/lo7181-long-update-and-lost-state
siburu Aug 13, 2025
add550c
parallelize to query chain while upgrading channel
Jul 28, 2025
001af49
remove debug code
Jul 30, 2025
d117e39
fix comment
Jul 31, 2025
302770c
refactoring
Aug 6, 2025
24878ff
enable missing state simulation on upgrade test
Aug 6, 2025
72674f6
refactoring
Aug 6, 2025
88058d9
test is to use fake lost state
Aug 6, 2025
53f0552
fix retrying
Aug 6, 2025
13daa8e
go fmt
Aug 12, 2025
07f68dc
update to name change
Aug 13, 2025
7932896
remove comment
Aug 15, 2025
097d21a
first impl to paralellize relaying process
Aug 6, 2025
3f08503
rebase
Aug 6, 2025
6a87d82
debug
Aug 12, 2025
2b2b624
add test
Aug 12, 2025
2fd5c41
go fmt
Aug 12, 2025
b806251
typo
Aug 13, 2025
7e8e036
fix timing in test
Aug 14, 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
77 changes: 77 additions & 0 deletions chains/debug/chain.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package debug

import (
"context"
"time"

"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"

"github.com/hyperledger-labs/yui-relayer/core"
)

type Chain struct {
config ChainConfig
OriginChain core.Chain
}

var _ core.Chain = (*Chain)(nil)

func (c *Chain) ChainID() string {
return c.OriginChain.ChainID()
}

func (c *Chain) Config() ChainConfig {
return c.config
}

func (c *Chain) Codec() codec.ProtoCodecMarshaler {
return c.OriginChain.Codec()
}

func (c *Chain) GetAddress() (sdk.AccAddress, error) {
return c.OriginChain.GetAddress()
}

// SetRelayInfo sets source's path and counterparty's info to the chain
func (c *Chain) SetRelayInfo(path *core.PathEnd, counterparty *core.ProvableChain, counterpartyPath *core.PathEnd) error {
return c.OriginChain.SetRelayInfo(path, counterparty, counterpartyPath)
}

func (c *Chain) Path() *core.PathEnd {
return c.OriginChain.Path()
}

func (c *Chain) Init(homePath string, timeout time.Duration, codec codec.ProtoCodecMarshaler, debug bool) error {
return c.OriginChain.Init(homePath, timeout, codec, debug)
}

func (c *Chain) SetupForRelay(ctx context.Context) error {
return c.OriginChain.SetupForRelay(ctx)
}

// LatestHeight queries the chain for the latest height and returns it
func (c *Chain) LatestHeight(ctx context.Context) (ibcexported.Height, error) {
return c.OriginChain.LatestHeight(ctx)
}

func (c *Chain) Timestamp(ctx context.Context, height ibcexported.Height) (time.Time, error) {
return c.OriginChain.Timestamp(ctx, height)
}

func (c *Chain) AverageBlockTime() time.Duration {
return c.OriginChain.AverageBlockTime()
}

func (c *Chain) RegisterMsgEventListener(listener core.MsgEventListener) {
c.OriginChain.RegisterMsgEventListener(listener)
}

func (c *Chain) SendMsgs(ctx context.Context, msgs []sdk.Msg) ([]core.MsgID, error) {
return c.OriginChain.SendMsgs(ctx, msgs)
}

func (c *Chain) GetMsgResult(ctx context.Context, id core.MsgID) (core.MsgResult, error) {
return c.OriginChain.GetMsgResult(ctx, id)
}
15 changes: 15 additions & 0 deletions chains/debug/codec.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package debug

import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/hyperledger-labs/yui-relayer/core"
)

// RegisterInterfaces register the module interfaces to protobuf
// Any.
func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
registry.RegisterImplementations(
(*core.ChainConfig)(nil),
&ChainConfig{},
)
}
45 changes: 45 additions & 0 deletions chains/debug/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package debug

import (
"fmt"

codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/hyperledger-labs/yui-relayer/core"
)

var _ core.ChainConfig = (*ChainConfig)(nil)

var _ codectypes.UnpackInterfacesMessage = (*ChainConfig)(nil)

func (cfg *ChainConfig) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error {
if cfg == nil {
return nil
}
if err := unpacker.UnpackAny(cfg.OriginChain, new(core.ChainConfig)); err != nil {
return err
}
return nil
}

func (c ChainConfig) Build() (core.Chain, error) {
if c.OriginChain == nil {
return nil, fmt.Errorf("OriginChain must be set")
}
if c.OriginChain.GetCachedValue() == nil {
return nil, fmt.Errorf("OriginChain.GetCachedValue() must be set")
}

originChain, err := c.OriginChain.GetCachedValue().(core.ChainConfig).Build()
if err != nil {
return nil, err
}

return &Chain{
config: c,
OriginChain: originChain,
}, nil
}

func (c ChainConfig) Validate() error {
return nil
}
Loading
Loading