Skip to content

Commit

Permalink
Merge pull request #38 from datachainlab/bump-lcp
Browse files Browse the repository at this point in the history
Bump lcp to v0.2.9

Signed-off-by: Jun Kimura <[email protected]>
  • Loading branch information
bluele authored Jun 19, 2024
2 parents 7f74a4a + 91226d1 commit 9612064
Show file tree
Hide file tree
Showing 17 changed files with 383 additions and 407 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ This repository contains multiple modules:

## Supported Versions

- [ibc-solidity v0.3.28](https://github.com/hyperledger-labs/yui-ibc-solidity/releases/tag/v0.3.28)
- [lcp v0.2.8](https://github.com/datachainlab/lcp/releases/tag/v0.2.8)
- [ethereum-elc v0.0.12](https://github.com/datachainlab/ethereum-elc/releases/tag/v0.0.12)
- [lcp-go v0.2.4](https://github.com/datachainlab/lcp-go/releases/tag/v0.2.4)
- [lcp-solidity v0.1.9](https://github.com/datachainlab/lcp-solidity/releases/tag/v0.1.9)
- [yui-relayer v0.5.3](https://github.com/hyperledger-labs/yui-relayer/releases/tag/v0.5.3)
- [ibc-solidity v0.3.29](https://github.com/hyperledger-labs/yui-ibc-solidity/releases/tag/v0.3.29)
- [lcp v0.2.9](https://github.com/datachainlab/lcp/releases/tag/v0.2.9)
- [ethereum-elc v0.0.13](https://github.com/datachainlab/ethereum-elc/releases/tag/v0.0.13)
- [lcp-go v0.2.5](https://github.com/datachainlab/lcp-go/releases/tag/v0.2.5)
- [lcp-solidity v0.1.12](https://github.com/datachainlab/lcp-solidity/releases/tag/v0.1.12)
- [yui-relayer v0.5.4](https://github.com/hyperledger-labs/yui-relayer/releases/tag/v0.5.4)
- [ethereum-ibc-relay-chain v0.3.4](https://github.com/datachainlab/ethereum-ibc-relay-chain/releases/tag/v0.3.4)
- [ethereum-ibc-relay-prover v0.3.0](https://github.com/datachainlab/ethereum-ibc-relay-prover/releases/tag/v0.3.0)

Expand Down Expand Up @@ -97,7 +97,7 @@ $ make -C ./tests/e2e/chains/tendermint image

### Prerequisite

- `lcp` command(from [lcp v0.2.7](https://github.com/datachainlab/lcp/releases/tag/v0.2.7)) is installed
- `lcp` command(from [lcp v0.2.9](https://github.com/datachainlab/lcp/releases/tag/v0.2.9)) is installed

### Launch local networks

Expand Down
37 changes: 19 additions & 18 deletions enclave/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions enclave/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ sgx-sw = [
log = { version = "0.4.8", default-features = false }
simple_logger = { git = "https://github.com/bluele/rust-simple_logger", branch = "sgx", default-features = false, features = ["sgx"] }

enclave-runtime = { git = "https://github.com/datachainlab/lcp", rev = "v0.2.8" }
tendermint-lc = { git = "https://github.com/datachainlab/lcp", rev = "v0.2.8", default-features = false }
ethereum-elc = { git = "https://github.com/datachainlab/ethereum-elc", rev = "v0.0.12", default-features = false }
enclave-runtime = { git = "https://github.com/datachainlab/lcp", rev = "v0.2.9" }
tendermint-lc = { git = "https://github.com/datachainlab/lcp", rev = "v0.2.9", default-features = false }
ethereum-elc = { git = "https://github.com/datachainlab/ethereum-elc", rev = "v0.0.13", default-features = false }

[patch."https://github.com/apache/teaclave-sgx-sdk.git"]
sgx_tstd = { rev = "v1.1.6", git = "https://github.com/apache/incubator-teaclave-sgx-sdk" }
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ go 1.21
require (
github.com/datachainlab/ethereum-ibc-relay-chain v0.3.4
github.com/datachainlab/ethereum-ibc-relay-prover v0.3.0
github.com/datachainlab/lcp-go v0.2.4
github.com/hyperledger-labs/yui-relayer v0.5.3
github.com/datachainlab/lcp-go v0.2.5
github.com/hyperledger-labs/yui-relayer v0.5.4
)

require (
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,8 @@ github.com/datachainlab/ethereum-ibc-relay-chain v0.3.4 h1:2mbvy6W/lm11SeQBgj110
github.com/datachainlab/ethereum-ibc-relay-chain v0.3.4/go.mod h1:PdSsegkRJiMWVGq+afDtXKRKg4p8hnmR1Yj5BgXkit0=
github.com/datachainlab/ethereum-ibc-relay-prover v0.3.0 h1:2gAoULm+kF9JZLNImkxLI7TCfBstfKrm4/leU6d1CR4=
github.com/datachainlab/ethereum-ibc-relay-prover v0.3.0/go.mod h1:OfuufukSThjjZXQtFyZqwY9csQNrJ/wIm0VLAUw3l4g=
github.com/datachainlab/lcp-go v0.2.4 h1:o2Ukt4EHrOoJFpIw5eXYpCt0gYjaIO+cfA3S+TYiJUI=
github.com/datachainlab/lcp-go v0.2.4/go.mod h1:pJR9B0YzFwRLzTh0TQPvTojdGSJbAVla8UUFNwjcOpg=
github.com/datachainlab/lcp-go v0.2.5 h1:mZrQ+iRDP98vClx/T9VyakKf3fxqSZYiatU73vzKr7M=
github.com/datachainlab/lcp-go v0.2.5/go.mod h1:XlbzEmc2BPBckuSLVZENQTYyJ/zrsK1269o9RZUpJHk=
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -809,8 +809,8 @@ github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXM
github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg=
github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc=
github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8=
github.com/hyperledger-labs/yui-relayer v0.5.3 h1:K7lcqkaqsGtpXImcz/cuClZsTtWCobLC9zh76KGzhP8=
github.com/hyperledger-labs/yui-relayer v0.5.3/go.mod h1:GeCb1dtZjtQdkBNw1L9+LAUHzNQQhQK+kkoOnZYffw0=
github.com/hyperledger-labs/yui-relayer v0.5.4 h1:yhvWI28Rcel55UsdmYWX0QE0W3P9aBSRetQh1k8VpZA=
github.com/hyperledger-labs/yui-relayer v0.5.4/go.mod h1:GeCb1dtZjtQdkBNw1L9+LAUHzNQQhQK+kkoOnZYffw0=
github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
Expand Down
2 changes: 2 additions & 0 deletions relayer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/datachainlab/ethereum-ibc-relay-chain/pkg/relay/ethereum/signers/hd"
ethereumlc "github.com/datachainlab/ethereum-ibc-relay-prover/relay"
lcp "github.com/datachainlab/lcp-go/relay"
rawsigner "github.com/datachainlab/lcp-go/relay/signers/raw"
lcptm "github.com/datachainlab/lcp-go/relay/tendermint"
tendermint "github.com/hyperledger-labs/yui-relayer/chains/tendermint/module"
"github.com/hyperledger-labs/yui-relayer/cmd"
Expand All @@ -21,6 +22,7 @@ func main() {
hd.Module{},
lcp.Module{},
lcptm.Module{},
rawsigner.Module{},
); err != nil {
fmt.Fprintln(os.Stderr, "Error:", err)
os.Exit(1)
Expand Down
8 changes: 7 additions & 1 deletion tests/e2e/cases/tm2eth/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ RLY_BIN ?= ../../../../bin/yrly
.PHONY: network
network:
$(MAKE) -C ../../chains/tendermint network
$(MAKE) -C ../../chains/ethereum network deploy extract-abi
$(MAKE) -C ../../chains/ethereum network
sleep 10
$(MAKE) -C ../../chains/ethereum deploy extract-abi

.PHONY: network-down
network-down:
Expand All @@ -26,3 +28,7 @@ test:
.PHONY: restore
restore:
RLY_BIN=$(RLY_BIN) ./scripts/restore

.PHONY: test-operators
test-operators:
RLY_BIN=$(RLY_BIN) ./scripts/test-operators
13 changes: 12 additions & 1 deletion tests/e2e/cases/tm2eth/configs/templates/ibc-0.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@
"key_expiration": 604800,
"elc_client_id": "07-tendermint-1",
"message_aggregation": true,
"is_debug_enclave": true
"is_debug_enclave": true,
"operators": [
"0xcb96F8d6C2d543102184d679D7829b39434E4EEc"
],
"operator_signer": {
"@type": "/relayer.provers.lcp.signers.raw.SignerConfig",
"private_key": "0x99b107441d0bce8e5b0078450f10f309910d8c0a2cc91671bd6cc1a284809642"
},
"operators_eip712_evm_chain_params": {
"chain_id": 15,
"verifying_contract_address": $LC_ADDRESS
}
}
}
17 changes: 14 additions & 3 deletions tests/e2e/cases/tm2eth/configs/templates/ibc-1.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"allow_lc_functions": {
"lc_address": $LC_ADDRESS,
"selectors": [
"0xba7da898",
"0x8d11da78"
"0xa97c61d6",
"0x6ac73aa0"
]
},
"gas_estimate_rate": {
Expand Down Expand Up @@ -51,6 +51,17 @@
"key_expiration": 604800,
"elc_client_id": "ethereum-0",
"message_aggregation": true,
"is_debug_enclave": true
"is_debug_enclave": true,
"operators": [
"0x9722414d09f43fb02235d739B50F4C027F43e657"
],
"operator_signer": {
"@type": "/relayer.provers.lcp.signers.raw.SignerConfig",
"private_key": "0x8a94e9f944a297c402a997aa9a60026ce47a6e018192d111c1703176bbc26651"
},
"operators_eip712_cosmos_chain_params": {
"chain_id": "ibc0",
"prefix": "ibc"
}
}
}
2 changes: 1 addition & 1 deletion tests/e2e/cases/tm2eth/scripts/gen_rly_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ mkdir -p $CONFIG_DIR
MRENCLAVE=$(${LCP_BIN} enclave metadata --enclave=./bin/enclave.signed.so | jq -r .mrenclave)
IBC_ADDRESS=`cat $ADDRESSES_DIR/IBCHandler`
LC_ADDRESS=`cat $ADDRESSES_DIR/LCPClient`
jq -n -f ${TEMPLATE_DIR}/ibc-0.json.tpl --arg MRENCLAVE ${MRENCLAVE} > ${CONFIG_DIR}/ibc-0.json
jq -n -f ${TEMPLATE_DIR}/ibc-0.json.tpl --arg MRENCLAVE ${MRENCLAVE} --arg LC_ADDRESS $LC_ADDRESS > ${CONFIG_DIR}/ibc-0.json
jq -n -f ${TEMPLATE_DIR}/ibc-1.json.tpl --arg MRENCLAVE ${MRENCLAVE} --arg IBC_ADDRESS ${IBC_ADDRESS} --arg LC_ADDRESS $LC_ADDRESS > ${CONFIG_DIR}/ibc-1.json
40 changes: 40 additions & 0 deletions tests/e2e/cases/tm2eth/scripts/test-operators
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

RLY="${RLY_BIN} --debug"

UPDATE_CMD="${RLY} lcp update-operators ibc01"

for IS_SRC in true false; do
echo "src=${IS_SRC}"
if [ "${IS_SRC}" = true ]; then
NEW_OPERATOR=0xcb96F8d6C2d543102184d679D7829b39434E4EEc
else
NEW_OPERATOR=0x9722414d09f43fb02235d739B50F4C027F43e657
fi

# should fail because nonce is 2
${UPDATE_CMD} --src=${IS_SRC} --nonce 2 --new_operators ${NEW_OPERATOR} --threshold_denominator 1 --threshold_numerator 1
status=$?
if [ $status -eq 0 ]; then
echo "expected failure"
exit 1
fi
echo "01: OK"

# should be successful
${UPDATE_CMD} --src=${IS_SRC} --nonce 1 --new_operators ${NEW_OPERATOR} --threshold_denominator 1 --threshold_numerator 1
status=$?
if [ $status -ne 0 ]; then
echo "unexpected failure"
exit 1
fi
echo "02: OK"

${UPDATE_CMD} --src=${IS_SRC} --nonce 2 --new_operators ${NEW_OPERATOR} --threshold_denominator 1 --threshold_numerator 1
status=$?
if [ $status -ne 0 ]; then
echo "unexpected failure"
exit 1
fi
echo "03: OK"
done
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from "@hyperledger-labs/yui-ibc-solidity/contracts/core/04-channel/IBCChannelUpgrade.sol";
import {IIBCHandler} from "@hyperledger-labs/yui-ibc-solidity/contracts/core/25-handler/IIBCHandler.sol";
import {OwnableIBCHandler} from "@hyperledger-labs/yui-ibc-solidity/contracts/core/25-handler/OwnableIBCHandler.sol";
import {MockClient} from "@hyperledger-labs/yui-ibc-solidity/contracts/clients/MockClient.sol";
import {MockClient} from "@hyperledger-labs/yui-ibc-solidity/contracts/clients/mock/MockClient.sol";

import {LCPProtoMarshaler} from "@datachainlab/lcp-solidity/contracts/LCPProtoMarshaler.sol";
import {AVRValidator} from "@datachainlab/lcp-solidity/contracts/AVRValidator.sol";
Expand Down
Loading

0 comments on commit 9612064

Please sign in to comment.