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

Feature/bandwidth token #832

Merged
merged 82 commits into from
Nov 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
ba99bd4
Remove check for bandwidth for incoming packets
neacsu Oct 13, 2021
480b966
Introduce BandwidthController for both types of bandwidth creds
neacsu Oct 14, 2021
55857d5
Add some non-coconut token bandwidth handling
neacsu Oct 15, 2021
b9d5956
Use thiserror for gateway-client lib
neacsu Oct 18, 2021
0cd1a61
Add error handling
neacsu Oct 18, 2021
643fe13
Unable to build for wasm for now
neacsu Oct 18, 2021
b78b3aa
Fix wasm strange error
neacsu Oct 18, 2021
6be4d11
Disable non-coconut credentials for wasm client
neacsu Oct 18, 2021
f244aa0
Check for status and throw the error up
neacsu Oct 18, 2021
94bf9e8
Send encrypted token cred from client
neacsu Oct 18, 2021
d23604b
Gateway receive message and signature validation
neacsu Oct 18, 2021
cd4152f
Put the correct amount of tokens that were burned
neacsu Oct 19, 2021
9153193
Merge remote-tracking branch 'origin/develop' into feature/bandwidth_…
neacsu Oct 19, 2021
187bc68
[ci skip] Generate TS types
neacsu Oct 19, 2021
b3ad5b5
Eth endpoint and secret key as config parameters
neacsu Oct 19, 2021
3dc675a
Add eth_endpoint config argument for gateway
neacsu Oct 20, 2021
f65985f
Update test as well
neacsu Oct 20, 2021
687389e
Separate panicable code from the safe one
neacsu Oct 20, 2021
e9f7083
Move some bandwidth controller panics up the call stack
neacsu Oct 20, 2021
79a3655
Save contract corresponding to the eth endpoint
neacsu Oct 20, 2021
b3b338e
Fix template
neacsu Oct 20, 2021
e62bf75
Pass the web3 interface as well
neacsu Oct 20, 2021
e844920
Made event reads possible in gateway
neacsu Oct 21, 2021
37c5f76
Add checks for event data
neacsu Oct 21, 2021
07fe590
Cosmos contract for double spending prevention
neacsu Oct 22, 2021
dc45a95
Add workflow for the new contract
neacsu Oct 22, 2021
2ca8804
Add validator rest URL to config
neacsu Oct 22, 2021
7385e84
Rename eth_events to erc20_bridge
neacsu Oct 22, 2021
8c3802a
Pass cosmos mnemonic as well, and put the nymd client in ERC20Bridge
neacsu Oct 22, 2021
b137343
Call cosmos contract for final verification
neacsu Oct 22, 2021
85526d8
Ask for config parameters in cli
neacsu Oct 22, 2021
be6c6fa
Fix various stuff
neacsu Oct 22, 2021
6e9bade
Increase timeout to allow gateway to check the two chains
neacsu Oct 22, 2021
91f825b
Put some logs for the new flow
neacsu Oct 22, 2021
b7b6d0d
Set consumed bandwidth invariantly of coconut feature
neacsu Oct 26, 2021
cb3d5f3
Fix clippy error
neacsu Oct 26, 2021
a87d935
Merge remote-tracking branch 'origin/develop' into feature/bandwidth_…
neacsu Oct 26, 2021
dddd772
Add non-coconut checks
neacsu Oct 26, 2021
f8f5b67
Use 2018 rust instead of 2021
neacsu Oct 29, 2021
e6e769c
More verbose nymd error
neacsu Nov 1, 2021
b9e907c
Merge remote-tracking branch 'origin/develop' into feature/bandwidth_…
neacsu Nov 2, 2021
7dee03f
Explicitly specify TOKENS_TO_BURN constant
neacsu Nov 2, 2021
71fdf4f
Put eth burn function in a constant
neacsu Nov 2, 2021
c23e629
Replace to_vec & append with iter & chain
neacsu Nov 2, 2021
949e183
Test for (de)serialization of TokenCredential
neacsu Nov 2, 2021
e6ec17c
Minor rename
neacsu Nov 2, 2021
a0c98e1
Separate credential creation from bandwidth claiming
neacsu Nov 2, 2021
8ea8aba
Switch from panics to errors when claiming coconut bandwidth
neacsu Nov 2, 2021
c9ee355
Another append changed to chain
neacsu Nov 2, 2021
c533085
Update QA cosmos contract address
neacsu Nov 2, 2021
dae69c7
Simplify build/test/clippy separation on coconut feature
neacsu Nov 2, 2021
8441e0f
Fix bad features arg positioning
neacsu Nov 3, 2021
1377999
Use the start_after in cosmos contract query
neacsu Nov 3, 2021
404673a
Set a limit in line with a range on cosmos queries
neacsu Nov 3, 2021
0ffa19f
Added unit tests for new cosmos contract
neacsu Nov 3, 2021
99850b5
Fix bandwidth_remaining comparation
neacsu Nov 3, 2021
2d2d050
Get remaining bandwidth from gateway
neacsu Nov 4, 2021
0f3ff87
Add contract build flag
neacsu Nov 4, 2021
2b2222a
Add a useful info log
neacsu Nov 4, 2021
afa87be
Use a more robust eth depth for release builds
neacsu Nov 4, 2021
aea13db
Include recipt logs in error message
neacsu Nov 4, 2021
175b799
Fix clippy for tests
neacsu Nov 4, 2021
8d0d047
Use Arc instead of clone
neacsu Nov 5, 2021
7414b6f
Rename as_bytes to to_bytes
neacsu Nov 5, 2021
19eb871
Make signature verification in contract more verbose
neacsu Nov 5, 2021
9fd41f8
Missed rename of paging constant
neacsu Nov 5, 2021
c71c974
Fix gateway start with coconut enabled
neacsu Nov 5, 2021
552e78b
Rename function to claim_token
neacsu Nov 5, 2021
8721fb4
Simplify nymd client setup
neacsu Nov 5, 2021
a14975f
Check with block buffer on gateway as well
neacsu Nov 5, 2021
4a3fba7
Update comment of double spending protection
neacsu Nov 5, 2021
351ff9c
Correct contract address
neacsu Nov 5, 2021
d016711
Backup the keypairs used for buying tokens, in case of error cases
neacsu Nov 5, 2021
612e789
Don't take any chances with the gateway timeout
neacsu Nov 5, 2021
021093b
Merge remote-tracking branch 'origin/develop' into feature/bandwidth_…
neacsu Nov 8, 2021
3cacf98
[ci skip] Generate TS types
neacsu Nov 8, 2021
d043f94
Updated cosmos contract to latest QA address
neacsu Nov 9, 2021
82d3624
Merge branch 'develop' into feature/bandwidth_token
neacsu Nov 9, 2021
44bbba4
Merge branch 'develop' into feature/bandwidth_token
neacsu Nov 10, 2021
550c50f
Add cli options for eth
neacsu Nov 10, 2021
e75a64f
Merge branch 'develop' into feature/bandwidth_token
neacsu Nov 10, 2021
36331e3
Update network monitor timeout value as well
neacsu Nov 10, 2021
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
71 changes: 7 additions & 64 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,78 +65,21 @@ jobs:
with:
command: clean

# BUILD
- name: Build gateway with coconut feature
- name: Build all binaries with coconut enabled
uses: actions-rs/cargo@v1
with:
command: build
args: --bin nym-gateway --features=coconut
args: --all --features=coconut

- name: Build native client with coconut feature
uses: actions-rs/cargo@v1
with:
command: build
args: --bin nym-client --features=coconut

- name: Build socks5 client with coconut feature
uses: actions-rs/cargo@v1
with:
command: build
args: --bin nym-socks5-client --features=coconut

- name: Build validator-api with coconut feature
uses: actions-rs/cargo@v1
with:
command: build
args: --bin nym-validator-api --features=coconut

# TEST
- name: Test gateway with coconut feature
uses: actions-rs/cargo@v1
with:
command: test
args: --bin nym-gateway --features=coconut

- name: Test native client with coconut feature
uses: actions-rs/cargo@v1
with:
command: test
args: --bin nym-client --features=coconut

- name: Test socks5 client with coconut feature
uses: actions-rs/cargo@v1
with:
command: test
args: --bin nym-socks5-client --features=coconut

- name: Test validator-api with coconut feature
- name: Run all tests with coconut enabled
uses: actions-rs/cargo@v1
with:
command: test
args: --bin nym-validator-api --features=coconut

# CLIPPY

- name: Run clippy on gateway with coconut feature
uses: actions-rs/cargo@v1
with:
command: clippy
args: --bin nym-gateway --features=coconut -- -D warnings
args: --all --features=coconut

- name: Run clippy on native client with coconut feature
uses: actions-rs/cargo@v1
with:
command: clippy
args: --bin nym-client --features=coconut -- -D warnings

- name: Run clippy on socks5 client with coconut feature
uses: actions-rs/cargo@v1
with:
command: clippy
args: --bin nym-socks5-client --features=coconut -- -D warnings

- name: Run clippy on validator-api with coconut feature
- name: Run clippy with coconut enabled
uses: actions-rs/cargo@v1
if: ${{ matrix.rust != 'nightly' }}
with:
command: clippy
args: --bin nym-validator-api --features=coconut -- -D warnings
args: --features=coconut -- -D warnings
46 changes: 46 additions & 0 deletions .github/workflows/erc20_bridge_contract.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: ERC20 Bridge Contract

on: [push, pull_request]

jobs:
erc20-bridge-contract:
# since it's going to be compiled into wasm, there's absolutely
# no point in running CI on different OS-es
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.rust == 'nightly' }}
strategy:
matrix:
rust: [ stable, beta, nightly ]
steps:
- uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: wasm32-unknown-unknown
override: true
components: rustfmt, clippy

- uses: actions-rs/cargo@v1
env:
RUSTFLAGS: '-C link-arg=-s'
with:
command: build
args: --manifest-path contracts/erc20-bridge/Cargo.toml --target wasm32-unknown-unknown
neacsu marked this conversation as resolved.
Show resolved Hide resolved

- uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path contracts/erc20-bridge/Cargo.toml

- uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path contracts/erc20-bridge/Cargo.toml -- --check

- uses: actions-rs/cargo@v1
if: ${{ matrix.rust != 'nightly' }}
with:
command: clippy
args: --manifest-path contracts/erc20-bridge/Cargo.toml -- -D warnings
2 changes: 2 additions & 0 deletions .github/workflows/mixnet_contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
components: rustfmt, clippy

- uses: actions-rs/cargo@v1
env:
RUSTFLAGS: '-C link-arg=-s'
with:
command: build
args: --manifest-path contracts/mixnet/Cargo.toml --target wasm32-unknown-unknown
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/wasm_client_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ jobs:
override: true
components: rustfmt, clippy

- uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path clients/webassembly/Cargo.toml --target wasm32-unknown-unknown
# token credentials (non-coconut) don't work for wasm right now
neacsu marked this conversation as resolved.
Show resolved Hide resolved
# - uses: actions-rs/cargo@v1
# with:
# command: build
# args: --manifest-path clients/webassembly/Cargo.toml --target wasm32-unknown-unknown

- uses: actions-rs/cargo@v1
with:
Expand All @@ -47,4 +48,4 @@ jobs:
# - uses: actions-rs/cargo@v1
# with:
# command: clippy
# args: --manifest-path clients/webassembly/Cargo.toml --target wasm32-unknown-unknown -- -D warnings
# args: --manifest-path clients/webassembly/Cargo.toml --target wasm32-unknown-unknown -- -D warnings
Loading