Skip to content
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

Feat/e2e test #60

Merged
merged 69 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
e8b319b
refactor node process
sh-cha Nov 8, 2024
8ceca18
Merge branch 'main' into feat/refactor
sh-cha Nov 12, 2024
b917ab9
refactor node, broadcaster
sh-cha Nov 14, 2024
563adc3
refactor provider
sh-cha Nov 14, 2024
68fd6f9
refactor merkle, types
sh-cha Nov 14, 2024
08f4a86
refactor db
sh-cha Nov 14, 2024
69e4936
refactor executor
sh-cha Nov 14, 2024
33ccf98
add migration function
sh-cha Nov 14, 2024
dd38121
change iterate name & append splitter to key when iterating
sh-cha Nov 14, 2024
b381e83
add LastProcessedBlockHeightKey migration
sh-cha Nov 14, 2024
b007fb1
only change key if it exists
sh-cha Nov 14, 2024
ed9e160
wrap errors to clarify them
sh-cha Nov 14, 2024
9a8bd87
wrap errors on key, provider
sh-cha Nov 14, 2024
d7af1a2
Merge branch 'main' into feat/refactor
sh-cha Nov 19, 2024
8c8f06f
Merge branch 'main' into feat/refactor
sh-cha Nov 20, 2024
5023980
wrap errors & merge main
sh-cha Nov 20, 2024
97119fe
makes log as production & add log-format flag
sh-cha Nov 20, 2024
4c46cc2
fix reverse iterate finding prev inclusive start key
sh-cha Nov 20, 2024
1296e94
db test
sh-cha Nov 20, 2024
2887114
db stage test
sh-cha Nov 21, 2024
9098a5b
save finalized tree when it exists
sh-cha Nov 21, 2024
9afa7b7
Merge branch 'main' into feat/refactor
sh-cha Nov 22, 2024
27a9023
merge cmd
sh-cha Nov 22, 2024
30a123a
merkle test
sh-cha Nov 22, 2024
9c2318f
merkle types test
sh-cha Nov 22, 2024
30cd52c
host deposit & txhandler test
sh-cha Nov 25, 2024
f45be9a
host handler test
sh-cha Nov 27, 2024
adae7b8
keys test
sh-cha Nov 27, 2024
1cab35c
txutil test
sh-cha Nov 27, 2024
e5849f0
child deposit oracle test
sh-cha Nov 27, 2024
46d8480
Merge branch 'main' into feat/refactor
sh-cha Nov 27, 2024
a44ad1f
refactor child db and add l2 sequence checker into handleInitiateWith…
sh-cha Nov 27, 2024
23fb66e
prepare tree, output test
sh-cha Nov 27, 2024
ae0d4c0
add version to working tree info & child withdrawal test
sh-cha Nov 28, 2024
30a1e63
child handle output test
sh-cha Nov 28, 2024
20ad016
child db handler query test
sh-cha Nov 28, 2024
4f37ae9
executor types test
sh-cha Nov 28, 2024
ef8118b
format
sh-cha Nov 28, 2024
372a326
delete oracle msg data from authz msg & oracle test
sh-cha Nov 29, 2024
cba75b1
update batch info test
sh-cha Dec 4, 2024
2cad263
batch test
sh-cha Dec 4, 2024
03d735c
add timestamp & tx hash to withdrawals (#54)
sh-cha Dec 4, 2024
4e83425
format
sh-cha Dec 4, 2024
2c3e4b7
add batch handler test & fix checkbatch test
sh-cha Dec 5, 2024
7be59a6
add some comments
sh-cha Dec 5, 2024
3336d8d
e2e interchaintest setup
sh-cha Dec 13, 2024
f2d1a04
add test-e2e to makefile
sh-cha Dec 13, 2024
73397a3
add syncing query
sh-cha Dec 16, 2024
24b35da
simple deposit e2e test
sh-cha Dec 16, 2024
0ee1726
Merge branch 'main' into feat/e2e-test
sh-cha Dec 16, 2024
5975cb1
syncing query
sh-cha Dec 16, 2024
f17aa94
create connect sidecar container & connect it to l1
sh-cha Dec 16, 2024
874efda
multiple txs e2e test
sh-cha Dec 18, 2024
1ce7c36
reconnect node test
sh-cha Dec 18, 2024
260b49f
batch reconstruction test
sh-cha Dec 23, 2024
c2e88f9
tx check err fix
sh-cha Dec 23, 2024
3bc2a82
format
sh-cha Dec 23, 2024
f9ca670
bug fix: set bech32 prefix to sdk config before building tx
sh-cha Dec 24, 2024
cb3dcec
use celestia custom tx building function
sh-cha Dec 24, 2024
29f6f5f
celestia batch reconstruction test
sh-cha Dec 24, 2024
9b7d3ca
add celestia version to readme
sh-cha Dec 24, 2024
ebf20ae
increment page
sh-cha Dec 24, 2024
e5bbd53
Update executor/querier.go
sh-cha Dec 24, 2024
1da2792
sync nil check
sh-cha Dec 24, 2024
ac49af8
check msg type url in msgexec
sh-cha Dec 24, 2024
9e38fed
authz msg length check
sh-cha Dec 24, 2024
00cb5dd
authz msg length check
sh-cha Dec 24, 2024
a599334
increase timeout of e2e test & add minor comments & add e2e to codeco…
beer-1 Dec 26, 2024
64f5fa4
address function return decoded address
sh-cha Jan 6, 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
1 change: 1 addition & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ ignore:
- "**/module.go"
- "x/ibc/testing"
- "testing/"
- "e2e/"
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ format:
### Tests
###############################################################################

test: test-unit
test: test-unit test-e2e

test-all: test-unit test-race test-cover

Expand All @@ -102,10 +102,13 @@ test-race:
test-cover:
@go test -mod=readonly -timeout 30m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock' ./...

test-e2e:
cd e2e && go test -v . -timeout 30m

benchmark:
@go test -timeout 20m -mod=readonly -bench=. ./...

.PHONY: test test-all test-cover test-unit test-race benchmark
.PHONY: test test-all test-cover test-unit test-race test-e2e benchmark

###############################################################################
### Protobuf ###
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Before running OPinit bots, make sure you have the following prerequisites insta

To ensure compatibility with the node version, check the following versions:

| L1 Node | MiniMove | MiniWasm | MiniEVM |
| ------- | -------- | -------- | ------- |
| v0.6.4+ | v0.6.5+ | v0.6.5+ | v0.6.7+ |
| L1 Node | MiniMove | MiniWasm | MiniEVM | Celestia-appd |
| ------- | -------- | -------- | ------- | ------------- |
| v0.6.4+ | v0.6.5+ | v0.6.5+ | v0.6.7+ | v3.2.0+ |

### Build and Configure

Expand Down
9 changes: 8 additions & 1 deletion challenger/challenger.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,14 @@ func (c *Challenger) RegisterQuerier() {
}
return ctx.JSON(pendingEvents)
})

c.server.RegisterQuerier("/syncing", func(ctx *fiber.Ctx) error {
status, err := c.GetStatus()
if err != nil {
return err
}
return ctx.JSON(*status.Host.Node.Syncing && *status.Child.Node.Syncing)
})
}

func (c *Challenger) getNodeStartHeights(ctx types.Context, bridgeId uint64) (l1StartHeight int64, l2StartHeight int64, startOutputIndex uint64, err error) {
Expand Down Expand Up @@ -283,7 +291,6 @@ func (c *Challenger) getNodeStartHeights(ctx types.Context, bridgeId uint64) (l1
}
}
}

return
}

Expand Down
10 changes: 9 additions & 1 deletion challenger/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,15 @@ func LoadChallenges(db types.DB) (challenges []challengertypes.Challenge, err er

func DeleteFutureChallenges(db types.DB, initialBlockTime time.Time) error {
deletingKeys := make([][]byte, 0)
iterErr := db.Iterate(challengertypes.ChallengeKey, challengertypes.PrefixedChallengeEventTime(initialBlockTime), func(key []byte, _ []byte) (stop bool, err error) {
iterErr := db.ReverseIterate(challengertypes.ChallengeKey, nil, func(key []byte, _ []byte) (stop bool, err error) {
beer-1 marked this conversation as resolved.
Show resolved Hide resolved
ts, _, err := challengertypes.ParseChallenge(key)
if err != nil {
return true, err
}
if !ts.After(initialBlockTime) {
return true, nil
}

deletingKeys = append(deletingKeys, key)
return false, nil
})
Expand Down
16 changes: 11 additions & 5 deletions cmd/opinitd/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ import (
)

const (
flagRecover = "recover"
flagMnemonicSrc = "source"
flagBech32Prefix = "bech32"
flagOutput = "output"
flagRecover = "recover"
flagMnemonicSrc = "source"
flagMnemonicString = "mnemonic"
flagBech32Prefix = "bech32"
flagOutput = "output"
)

type keyJsonOutput map[string]keyJsonOutputElem
Expand Down Expand Up @@ -79,6 +80,7 @@ $ keys add localnet key1
$ keys add l2 key2 --bech32 celestia
$ keys add l2 key2 --recover
$ keys add l2 key2 --recover --source mnemonic.txt
$ keys add l2 key2 --recover --mnemonic "[mnemonic...]"
$ keys add l2 key2 --output json`),
RunE: func(cmd *cobra.Command, args []string) error {
chainId := args[0]
Expand Down Expand Up @@ -106,9 +108,12 @@ $ keys add l2 key2 --output json`),
mnemonic := ""
recoverFlag, _ := cmd.Flags().GetBool(flagRecover)
mnemonicSrc, _ := cmd.Flags().GetString(flagMnemonicSrc)
mnemonicString, _ := cmd.Flags().GetString(flagMnemonicString)

if recoverFlag {
if mnemonicSrc != "" {
if mnemonicString != "" {
mnemonic = mnemonicString
} else if mnemonicSrc != "" {
file, err := os.Open(mnemonicSrc)
if err != nil {
return err
Expand Down Expand Up @@ -172,6 +177,7 @@ $ keys add l2 key2 --output json`),
}
cmd.Flags().Bool(flagRecover, false, "Provide seed phrase to recover existing key instead of creating")
cmd.Flags().String(flagMnemonicSrc, "", "Import mnemonic from a file")
cmd.Flags().String(flagMnemonicString, "", "Import mnemonic from string")
cmd.Flags().String(flagBech32Prefix, "init", "Bech32 prefix")
cmd.Flags().String(flagOutput, "plain", "Output format (plain|json)")
return cmd
Expand Down
Loading
Loading