Skip to content

Commit

Permalink
Merge pull request #5 from rarimo/update/v1.1.0
Browse files Browse the repository at this point in the history
Update: v1.1.0
  • Loading branch information
olegfomenko authored Nov 29, 2023
2 parents 78b2a92 + 566dc00 commit f3d881f
Show file tree
Hide file tree
Showing 107 changed files with 6,513 additions and 1,823 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+'

jobs:
converge:
name: Converge
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3
with:
Expand All @@ -28,7 +28,32 @@ jobs:
docker version
echo $GITHUB_REPOSITORY
echo $GITHUB_REF_NAME
- name: Run Build
run: |
. $(werf ci-env github --as-file)
werf export service --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_REF_NAME
werf export service --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_REF_NAME
- uses: shrink/actions-docker-extract@v3
id: extract
with:
image: ghcr.io/$GITHUB_REPOSITORY:$GITHUB_REF_NAME
path: "/usr/local/bin/rarimo-core"

- uses: ncipollo/release-action@v1
id: create-release
with:
allowUpdates: true
tag: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{steps.extract.outputs.destination}}/rarimo-core
asset_name: rarimo-core-alpine-linux-amd64
asset_content_type: application/octet-stream
15 changes: 15 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
before:
hooks:
- go mod tidy
- go mod vendor

builds:
- id: linux-amd64-build
main: ./cmd/rarimo-cored
binary: rarimo-core
env:
- CGO_ENABLED=1
goos:
- linux
goarch:
- amd64
32 changes: 27 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)


***Chains:***

* [***Mainnet information***](./docs/common/mainnet/001-mainnet.md)

* [***Testnet (Mainnet-beta) information***](./docs/common/testnet/001-testnet.md)

## Introduction

**rarimo-core** is a blockchain built using Cosmos SDK and Tendermint and created with [Ignite CLI](https://ignite.com/cli).
**rarimo-core** is a blockchain built using Cosmos SDK and Tendermint and created
with [Ignite CLI](https://ignite.com/cli).

Based on Tendermint + Cosmos SDK blockchain core the main goal is to provide validated information about different cross-chain operations.
Based on Tendermint + Cosmos SDK blockchain core the main goal is to provide validated information about different
cross-chain operations.

Documentation:

* [Rarimo core modules business logic](./x/README.md)
* [Bridge contract architecture](./docs/common/contracts/001-contracts.md)
* [Bridging flow overview](./docs/common/bridging/001-bridging.md)
Expand All @@ -25,22 +28,41 @@ Documentation:
### Install

Use

```shell
ignite chain build
```

If it fails in generate proto stage with error on etheremint .proto files just re-execute that command or try to add `--clear-cache` flag.
If it fails in generate proto stage with error on etheremint .proto files just re-execute that command or try to
add `--clear-cache` flag.

### Generate proto files

Use

```shell
ignite generate proto-go
```

If it fails in generate proto stage with error on etheremint .proto files remove `./proto/ethermint` package and execute command again.
If it fails in generate proto stage with error on etheremint .proto files remove `./proto/ethermint` package and execute
command again.
DO NOT FORGET TO RETURN DELETED PACKAGE.

## Versioning

Rarimo core leverages on the following branches:

- `master` branch with vanilla core version
- `mainnet-beta` branch with testnet core with all testnet upgrades
- `mainnet` branch with mainnet core with all mainnet upgrades

For the tags we are using an approach when stable releases with `vX.X.X` tag has only the `mainnet` core. On the other
side `mainnet-beta` releases are build under `vX.X.X-rcX` tag. For the master branch releases only hash tagged images
will be provided.

Before creating the `mainnet` release be sure that it includes all unreleased changes from `mainnet-beta` and then
select the corresponding version number that will cover all released tags on `mainnet-beta`.

## Learn more

- [Ignite CLI](https://ignite.com/cli)
Expand Down
57 changes: 0 additions & 57 deletions docker-compose.yaml

This file was deleted.

107 changes: 55 additions & 52 deletions docs/common/bridging/002-identity.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,47 @@ title: Identity transfers
# Identity transfers

Identity transfers currently implemented in the following way:
- There is an operation type `IDENTITY_DEFAULT_TRANSFER` that should be used to transfer simple state from one chain to another.

- There are an operation types `IDENTITY_GIST_TRANSFER` and `IDENTITY_STATE_TRANSFER` that have to be used fore
transferring state transitions from one chain to another.

- An [evm-identity-oracle-svc](https://github.com/rarimo/evm-identity-saver-svc) exists, that is responsible
for delivering information from certain Iden3 state contract into the Rarimo chain.

- After delivering information about state update, oracles (`evm-identity-saver-svc`) vote for information correctness.
- After delivering information about state or GIST update, oracles (`evm-identity-saver-svc`) vote for information
correctness.

- After successful voting, the threshold signature producers provides the ECDSA signature for state update information hash.
- After successful voting, the threshold signature producers provides the ECDSA signature for state update information
hash.

- There is a [modified state smart contracts](https://gitlab.com/rarimo/polygonid/contracts) that accepts state updates with ECDSA signature instead of ZK proof of state update validity.
- There is a [modified state smart contracts](https://github.com/rarimo/polygonid-integration-contracts) that accepts
state updates with ECDSA signature instead of ZK proof of state update validity.

- Such smart contract should be deployed into every chain that we have to support.

- The information about state update with its witness (ECDSA signature) can be delivered into modified state smart contracts on the target chain by everyone.
Also, the [relayer service](https://gitlab.com/rarimo/polygonid/relayer-svc/) exists, that tracks new state update operations, their signatures and submits state update transactions to the target chain.
- The information about state update with its witness (ECDSA signature) can be delivered into modified state smart
contracts on the target chain by everyone.

- Also, the [relayer service](https://github.com/rarimo/identity-relayer-svc) exists, that tracks new state and
GIST update operations, their signatures and submits if requested transactions to the target chain. For the DApp it
can
be used in the following way:
- PolygonID wallet generates on-chain zkp based on information from Polygon chain state smart contact.
- After receiving the proof on your application, using corresponding public signals you can trigger the transfer of
required state and GIST hashes.

----

## Iden3

TBD
To explore how the Iden3 protocol works please visit their [documentation](https://docs.iden3.io/).

----

## Identity saver (oracle)
## [Identity saver (oracle)](https://github.com/rarimo/evm-identity-saver-svc)

In the current implementation the identity saver subscribes to the certain EVM chain state smart contract and tracks the `StateLibStateUpdated` events.
In the current implementation the identity saver subscribes to the certain EVM chain state smart contract and tracks
the `StateLibStateUpdated` events.

Event definition:

Expand All @@ -42,16 +56,16 @@ package main
import "math/big"

type StateLibStateUpdated struct {
Id *big.Int
BlockN *big.Int
Timestamp *big.Int
State *big.Int
Raw types.Log // Blockchain specific contextual infos
Id *big.Int
BlockN *big.Int
Timestamp *big.Int
State *big.Int
Raw types.Log // Blockchain specific contextual infos
}

```

The following configuration .yaml file should be provided to launch your oracle:
The following configuration ___.yaml___ file should be provided to launch your oracle:

```yaml
log:
Expand Down Expand Up @@ -102,7 +116,8 @@ state_contract_cfg:
After fetching of some event, oracle will create the corresponding transaction and submit it to the Rarimo blockchain.
After transaction appears in Rarimo blockchain all chain oracles have to vote for its correctness.
So they will fetch the information about state update from Rarimo chain, verify it and submit their votes (YES/NO answers).
So they will fetch the information about state update from Rarimo chain, verify it and submit their votes (YES/NO
answers).
For submitting transactions, savers (oracles) uses the [broadcaster-svc](https://github.com/rarimo/broadcaster-svc).
It accepts the transaction by GRPC endpoint, signs it with configured private key and submits it to the Rarimo chain.
Expand Down Expand Up @@ -135,13 +150,14 @@ cosmos:
```
Explore the simple docker-compose file to run the described services:
```yaml
version: "3.7"

services:

broadcaster:
image: registry.github.com/rarimo/broadcaster-svc:v1.0.1
image: ghcr.io/rarimo/broadcaster-svc:v1.0.2
restart: unless-stopped
depends_on:
- broadcaster-db
Expand All @@ -163,47 +179,40 @@ services:
- broadcaster-data:/pgdata

evm-identity-saver:
image: registry.github.com/rarimo/evm-identity-saver-svc:v1.0.2
image: ghcr.io/rarimo/evm-identity-saver-svc:v1.0.6
restart: unless-stopped
depends_on:
- broadcaster
- broadcaster
volumes:
- ./config/evm-saver.yaml:/config.yaml
- ./config/evm-saver.yaml:/config.yaml
environment:
- KV_VIPER_FILE=/config.yaml
- KV_VIPER_FILE=/config.yaml
entrypoint: sh -c "evm-identity-saver-svc run state-update-all"
```
----
## Relayer service
## [Relayer service](https://github.com/rarimo/identity-relayer-svc)
Relayer service is responsible for fetching information from Rarimo chain about new signatures for `IDENTITY_DEFAULT_TRANSFER` operations.
When the signature has been provided, relayer creates the EVM transaction to the configured smart contract with given signature, merkle path and state information.

It will be the call to
```
function signedTransitState(
uint256 prevState_,
uint256 prevGist_,
(uint256,uint256,uint256,uint256,uint256) stateData_,
(uint256,uint256,uint256,uint256) gistData_,
bytes proof_
) returns()
```
Relayer service is responsible for fetching information from Rarimo chain about new signatures
for `IDENTITY_GIST_TRANSFER` and `IDENTITY_STATE_TRANSFER` operations.

The following configuration .yaml file should be provided to launch your raleyer service:

```yaml
log:
disable_sentry: true
level: debug
## Redis connect information
redis:
addr: redis:6379
## Password can be empty
password:
# The port to run on
listener:
addr: :8000
# PostgreSQL DB connect
db:
url: "postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable"
# Rarimo core RPCs
core:
addr: tcp://validator:26657
Expand All @@ -223,14 +232,12 @@ evm:
chain_id: 1
relay:
target_chain: "Ethereum"
## Configuration to perform insta submitting (on launch) for any old confirmation from core that contains state update messages.
insta_submit_enabled: false
insta_submit_conf: ""
# Flag the indicates should service iterate over all existing transfer operation and fill the database
catchup_disabled: true
```

Explore the simple docker-compose file to run described services:

```yaml
version: "3.7"
Expand Down Expand Up @@ -260,10 +267,6 @@ services:

2. Currently, running of your oracle service requires staking of RMO tokens in Rarimo chain.

3. Oracle service in current implementation supports subscribing only for one certain issuer state updates. (Not relevant with `[email protected]`)

4. Relayer service in current implementation submits all state updates to the target chain. No filtering for issuer id is provided.

5. Support of certain smart contract and issuer by oracles requires the voting between all active oracles for that chain.
It means that for your chain all other oracles have to update their configuration to support your smart contract and issuer.
Also, the chain-clone can be added to the Rarimo to split oracle groups.
3. Support of certain smart contract and issuer by oracles requires the voting between all active oracles for that
chain. It means that for your chain all other oracles have to update their configuration to support your smart
contract and issuer. Also, the chain-clone can be added to the Rarimo to split oracle groups.
Loading

0 comments on commit f3d881f

Please sign in to comment.