Skip to content

Commit

Permalink
Merge branch 'e2e-testings' of https://github.com/oraichain/Gravity-B…
Browse files Browse the repository at this point in the history
…ridge into e2e-testings
  • Loading branch information
tubackkhoa committed Jan 8, 2023
2 parents 72ae382 + a22c791 commit 1fba927
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 8 deletions.
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:

gravity:
container_name: gravity
image: oraichain/foundation-gravity-module:0.0.1 # docker build -t oraichain/foundation-gravity-module:0.0.1 ./module
image: oraichain/foundation-oraibridge-module:0.0.1 # docker build -t oraichain/foundation-oraibridge-module:0.0.1 ./module
working_dir: /workspace
restart: on-failure
ports:
Expand All @@ -20,7 +20,7 @@ services:

first_fork:
container_name: first_fork
image: oraichain/foundation-gravity-fork:0.0.1 # docker build -t oraichain/foundation-gravity-fork:0.0.1 ./solidity
image: oraichain/foundation-oraibridge-evmfork:0.0.1 # docker build -t oraichain/foundation-oraibridge-evmfork:0.0.1 ./solidity
working_dir: /workspace
restart: on-failure
ports:
Expand All @@ -33,7 +33,7 @@ services:

second_fork:
container_name: second_fork
image: oraichain/foundation-gravity-fork:0.0.1
image: oraichain/foundation-oraibridge-evmfork:0.0.1
working_dir: /workspace
restart: on-failure
ports:
Expand Down
10 changes: 10 additions & 0 deletions module/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM oraichain/foundation-oraibridge-module:0.0.1 as builder
RUN upx --best --lzma /workspace/build/gravity

FROM alpine:3.16
WORKDIR /workspace
RUN apk update
# need to install build-base to run go oraid binary
RUN apk add nano bash build-base jq
COPY --from=builder /workspace/build/gravity /usr/bin
CMD [ "gravity version" ]
14 changes: 9 additions & 5 deletions module/app/assert.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,21 @@ func (app *Gravity) assertBech32PrefixMatches(ctx sdk.Context) {
panic("Invalid app/config/keeper state")
}

err := app.bech32IbcKeeper.SetNativeHrp(ctx, config.GetBech32AccountAddrPrefix())
if err != nil {
panic(sdkerrors.Wrap(err, "Unable to start, bech32ibc module not initialized to the correct prefix"))
}

nativePrefix, err := app.bech32IbcKeeper.GetNativeHrp(ctx)
if err != nil {
panic(sdkerrors.Wrap(err, "Error obtaining bech32ibc NativeHrp"))
}
configPrefix := config.GetBech32AccountAddrPrefix()
if nativePrefix != configPrefix {
// err := app.bech32IbcKeeper.SetNativeHrp(ctx, configPrefix)
// if err != nil {
// panic(sdkerrors.Wrap(err, "Unable to start, bech32ibc module not initialized to the correct prefix"))
// }
// nativePrefix, err := app.bech32IbcKeeper.GetNativeHrp(ctx)
// if nativePrefix != configPrefix {
// panic(fmt.Sprintf("Mismatched bech32ibc NativeHrp (%v) and config Bech32 Account Prefix (%v)",
// nativePrefix, configPrefix))
// }
panic(fmt.Sprintf("Mismatched bech32ibc NativeHrp (%v) and config Bech32 Account Prefix (%v)",
nativePrefix, configPrefix))
}
Expand Down
17 changes: 17 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,20 @@ You can keep up with the latest development by watching our [public standups](ht

- There must be a validator set update made on the Ethereum contract by calling the `updateValset` method at least once every Cosmos unbonding period (usually 2 weeks). This is because if there has not been an update for longer than the unbonding period, the validator set stored by the Ethereum contract could contain validators who cannot be slashed for misbehavior.
- Cosmos full nodes do not verify events coming from Ethereum. These events are accepted into the Cosmos state based purely on the signatures of the current validator set. It is possible for the validators with >2/3 of the stake to put events into the Cosmos state which never happened on Ethereum. In this case observers of both chains will need to "raise the alarm". We have built this functionality into the relayer.

## Build

### Development

```bash

# OraiBridge core build
docker build -t oraichain/foundation-oraibridge-module:0.0.1 ./module

# EVM fork build with Hardhat environment
docker build -t oraichain/foundation-oraibridge-evmfork:0.0.1 ./solidity

# Production build
docker build -t oraichain/foundation-oraibridge-module-prod:0.0.1 -f module/Dockerfile.prod ./module

```
10 changes: 10 additions & 0 deletions upgrade-tests/start-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

GRAVITY_HOME=${1:-data}
NODE_ID=${2-a079edb265cbde6f8eeecd6f22a57dfdf3ab7b34}

rm -rf $GRAVITY_HOME

cp -r "$GRAVITY_HOME-before-upgrade" $GRAVITY_HOME

gravity start --home $GRAVITY_HOME --p2p.persistent_peers $NODE_ID@0.0.0.0:26656

0 comments on commit 1fba927

Please sign in to comment.