Skip to content
This repository has been archived by the owner on Aug 24, 2023. It is now read-only.

feat(meta): Add meta-consensus-rpc module. #64

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
dbc6f28
Add meta-consensus-rpc module initial code.
surangap Aug 24, 2022
9f6206b
Add sample test to rpc module.
surangap Aug 24, 2022
7df137b
Update get_block_hash() test
surangap Aug 24, 2022
b07dff9
Updated test.
surangap Aug 25, 2022
ea94efc
Add extrinsics_encode_decode test.
surangap Aug 29, 2022
1246cca
Add block_encode_decode test.
surangap Aug 30, 2022
877dd19
Add block_import test.
surangap Aug 30, 2022
6d183a2
Update block_import test.
surangap Sep 1, 2022
d76c90a
Update get_block() rpc.
surangap Sep 1, 2022
efc7f42
Add DNCTx, DMCTx structs.
surangap Sep 1, 2022
6cd3069
Add mint_block() RPC.
surangap Sep 1, 2022
e8edea8
Remove support for engine_createBlock() RPC.
surangap Sep 1, 2022
7b7edb5
Merge branch 'main' into surangap/meta-consensus-rpc
surangap Sep 1, 2022
76bea7a
Add block_mint test.
surangap Sep 2, 2022
99111ad
Add connect_block() RPC.
surangap Sep 9, 2022
7c9e652
Merge branch 'main' into surangap/meta-consensus-rpc
surangap Sep 9, 2022
a0f7c75
Add error handling to get_block() RPC.
surangap Sep 11, 2022
26c72fd
Add error handling to mint_block() RPC.
surangap Sep 11, 2022
f717df7
Fix block_import_meta_consensus_rpc test.
surangap Sep 11, 2022
6b72af9
Remove unused imports.
surangap Sep 11, 2022
3d28aab
Fix rustfmt
surangap Sep 11, 2022
26fc599
chore(ts-tests): add e2e contracts (#66)
canonbrother Sep 12, 2022
c3f1303
bump(deps): update dependency @birthdayresearch/contented to v1.6.1 (…
renovate[bot] Sep 12, 2022
a21094a
refactor(workflows): cleanup and generalize workflows, also add pnpm …
fuxingloh Sep 12, 2022
e5ba1cc
bump(deps): update dependency turbo to ^1.4.6 (#82)
renovate[bot] Sep 12, 2022
5c7bb96
chore(ts-tests): refactor `ts-tests/*` to follow pnpm and turbo works…
fuxingloh Sep 13, 2022
d6196da
chore(.idea): check in codeStyles and .gitignore for `.idea/*` (#87)
fuxingloh Sep 13, 2022
8547030
refactor(testcontainers): move testcontainers into its own package (#67)
fuxingloh Sep 14, 2022
ce06fa6
chore(docs): add documentation structure for MetaChain (#90)
fuxingloh Sep 14, 2022
d1a1617
chore(governance): add area/ain to earmark issues/pr that requires ch…
fuxingloh Sep 14, 2022
6d3bf1f
chore(docs): add draft of MetaChain consensus (#101)
fuxingloh Sep 18, 2022
d9704c4
docs(token-bridge): add draft for MetaChain Token & Bridge (#102)
fuxingloh Sep 26, 2022
90e5b28
chore(ts-tests): Replace MetaDContainer with MetaChainContainer (#104)
canonbrother Sep 27, 2022
5352280
rename DNC to DFC
canonbrother Sep 28, 2022
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 .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ target
netlify.toml
*.md
Dockerfile
ts-tests
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/1-bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ about: Report a bug encountered with this project
labels: kind/bug
---

<!--
<!--
Please use this template while reporting a bug and provide as much info as possible.

If the matter is security related, please disclose it privately via security@defichain.com
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/3-general.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ labels: kind/question
<!--
If the matter is security related, please disclose it privately via security@defichain.com
-->

2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
#### What this PR does / why we need it:

#### Which issue(s) does this PR fixes?:

<!--
(Optional) Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->

Fixes #

#### Additional comments?:
5 changes: 3 additions & 2 deletions .github/governance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: v1
issue:
labels:
- prefix: triage
list: [ "accepted" ]
list: ['accepted']
multiple: false
author_association:
collaborator: true
Expand Down Expand Up @@ -39,6 +39,7 @@ issue:
- packages
- meta
- docs
- ain
multiple: true
needs:
comment: |
Expand Down Expand Up @@ -78,7 +79,7 @@ issue:

- prefix: priority
multiple: false
list: [ "urgent-now", "important-soon" ]
list: ['urgent-now', 'important-soon']
author_association:
collaborator: true
member: true
Expand Down
26 changes: 13 additions & 13 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,63 +34,63 @@ labels:
- label: area/workflow
sync: true
matcher:
files: ".github/**"
files: '.github/**'

- label: area/packages
sync: true
matcher:
files: "packages/**"
files: 'packages/**'

- label: area/meta
sync: true
matcher:
files: "meta/**"
files: 'meta/**'

- label: area/docs
sync: true
matcher:
files: "docs/**"
files: 'docs/**'

- label: meta/consensus
sync: true
matcher:
files: "meta/meta-consensus/**"
files: 'meta/meta-consensus/**'

- label: meta/node
sync: true
matcher:
files: "meta/meta-node/**"
files: 'meta/meta-node/**'

- label: meta/runtime
sync: true
matcher:
files: "meta/meta-runtime/**"
files: 'meta/meta-runtime/**'

- label: packages/network
sync: true
matcher:
files: "packages/network/**"
files: 'packages/network/**'

- label: packages/testcontainers
sync: true
matcher:
files: "packages/testcontainers/**"
files: 'packages/testcontainers/**'

- label: packages/testsuite
sync: true
matcher:
files: "packages/testsuite/**"
files: 'packages/testsuite/**'

- label: packages/typescript
sync: true
matcher:
files: "packages/typescript/**"
files: 'packages/typescript/**'

checks:
- context: "Semantic Pull Request"
- context: 'Semantic Pull Request'
description:
success: Ready for review & merge.
failure: "Missing semantic title or label for merge [kind(directory): title]"
failure: 'Missing semantic title or label for merge [kind(directory): title]'
labels:
any:
- kind/feature
Expand Down
3 changes: 3 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
name: area/meta
- color: fbca04
name: area/packages
- color: fbca04
name: area/ain
description: issues/pr that requires changes on the DeFiCh/ain codebase.

# Meta
- color: 0f1a01
Expand Down
135 changes: 102 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,37 @@ name: CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Build:
lint_cargo_fmt:
name: Lint (cargo fmt)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2

- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3.0.8
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # tag=v1.0.7
with:
profile: minimal
toolchain: nightly
target: wasm32-unknown-unknown
default: true
override: true
components: rustfmt

- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # tag=v1.0.3
with:
command: build
args: --release --all
command: fmt
args: --all -- --check

lint_cargo_fmt:
name: Lint (cargo fmt)
lint_cargo_clippy:
name: Lint (cargo clippy)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
Expand All @@ -52,34 +44,101 @@ jobs:
target: wasm32-unknown-unknown
default: true
override: true
components: rustfmt
components: clippy

- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # tag=v1.0.3
- uses: actions-rs/clippy-check@b5b5f21f4797c02da247df37026fcd0a5024aa4d # tag=v1.0.7
with:
command: fmt
args: --all -- --check
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features

lint_cargo_clippy:
name: Lint (cargo clippy)
lint_pnpm_prettier:
name: Lint (pnpm prettier)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2

- uses: pnpm/action-setup@10693b3829bf86eb2572aef5f3571dcf5ca9287d # tag=v2.2.2
with:
version: 7

- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3.4.1
with:
node-version: 16
cache: pnpm

- run: pnpm install --frozen-lockfile

- run: pnpm prettier --check .

lint_pnpm_eslint:
name: Lint (pnpm eslint)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2

- uses: pnpm/action-setup@10693b3829bf86eb2572aef5f3571dcf5ca9287d # tag=v2.2.2
with:
version: 7

- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3.4.1
with:
node-version: 16
cache: pnpm

- run: pnpm install --frozen-lockfile

- run: pnpm turbo run lint

build_cargo:
name: Build (cargo)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2

- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3.0.8
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # tag=v1.0.7
with:
profile: minimal
toolchain: nightly
target: wasm32-unknown-unknown
default: true
override: true
components: clippy

- uses: actions-rs/clippy-check@b5b5f21f4797c02da247df37026fcd0a5024aa4d # tag=v1.0.7
- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # tag=v1.0.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
command: build
args: --release --all

Test:
build_pnpm:
name: Build (pnpm)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2

- uses: pnpm/action-setup@10693b3829bf86eb2572aef5f3571dcf5ca9287d # tag=v2.2.2
with:
version: 7

- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3.4.1
with:
node-version: 16
cache: pnpm

- run: pnpm install --frozen-lockfile

- run: pnpm build

test_cargo:
name: Test (cargo)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
Expand Down Expand Up @@ -109,14 +168,24 @@ jobs:
files: ${{ steps.coverage.outputs.report }}
fail_ci_if_error: true

e2e:
test_pnpm:
name: Test (pnpm)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2

- uses: pnpm/action-setup@10693b3829bf86eb2572aef5f3571dcf5ca9287d # tag=v2.2.2
with:
version: 7

- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3.4.1
with:
node-version: '16'
cache: 'npm'
cache-dependency-path: 'ts-tests/package-lock.json'
- run: cd ts-tests && npm ci && npm t
node-version: 16
cache: pnpm

- run: pnpm install --frozen-lockfile
- run: pnpm test -- -- --maxWorkers=100% --coverage

- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # tag=v3.1.0
with:
fail_ci_if_error: true
6 changes: 3 additions & 3 deletions .github/workflows/oss-governance-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: OSS Governance

on:
pull_request_target:
types: [ synchronize, opened, labeled, unlabeled ]
types: [synchronize, opened, labeled, unlabeled]
issues:
types: [ opened, labeled, unlabeled ]
types: [opened, labeled, unlabeled]
issue_comment:
types: [ created ]
types: [created]

permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/oss-governance-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: OSS Governance

on:
pull_request_target:
types: [ opened, edited, synchronize ]
types: [opened, edited, synchronize]

permissions:
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/oss-governance-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: OSS Governance

on:
push:
branches: [ main ]
paths: [ .github/labels.yml ]
branches: [main]
paths: [.github/labels.yml]

permissions:
contents: read
Expand Down
Loading