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

Tiago's integration branch #1337

Closed
wants to merge 919 commits into from
Closed
Changes from 15 commits
Commits
Show all changes
919 commits
Select commit Hold shift + click to select a range
1626479
changelog: add #1218
tzemanovic Mar 14, 2023
5090f4f
Fix test_transfer_to_eth_progress()
sug0 May 10, 2023
fe41b82
Change Bridge pool warning msg
sug0 May 10, 2023
1296b2e
Removal equality check from comparison
sug0 May 10, 2023
5fa7fea
Add colors dependency
sug0 May 10, 2023
7941839
Pretty print error msgs
sug0 May 10, 2023
f8a9b02
fixup! Pretty print error msgs
sug0 May 10, 2023
fd0ef46
Merge pull request #1340 from anoma/tiago/ethbridge/warn-bp-transfer
sug0 May 10, 2023
e49f4c8
Add CLI error for when Namada is ahead of smart contract
sug0 May 10, 2023
c0a9798
Merge pull request #1346 from anoma/tiago/ethbridge/warn-bp-transfer-2
sug0 May 10, 2023
6bd986c
Prevent unsuccessful validator set update relays
sug0 May 10, 2023
88d31c7
Offer more ctx to justify invalid epoch nonces
sug0 May 10, 2023
aa8b5ea
fixup! Offer more ctx to justify invalid epoch nonces
sug0 May 10, 2023
d544410
Test relay op statuses
sug0 May 10, 2023
8887f34
Add a shutdown signal handler
sug0 May 10, 2023
491ea60
Add shutdown handler to valset upd daemon
sug0 May 10, 2023
c6e4814
fixup! Add shutdown handler to valset upd daemon
sug0 May 10, 2023
61ff520
Merge pull request #1022 from anoma/brent/pos-update-docs-and-specs
cwgoes May 11, 2023
be3d20b
Create control flow module
sug0 May 11, 2023
e336e76
Move shutdown signal installer to control flow
sug0 May 11, 2023
30f290a
Use shutdown signal handler in abortable spawner
sug0 May 11, 2023
57c9a74
Add safe mode flag to the valset upd relayer
sug0 May 11, 2023
9af70a3
fixup! Move shutdown signal installer to control flow
sug0 May 11, 2023
72265cd
fixup! Move shutdown signal installer to control flow
sug0 May 11, 2023
4f45eff
Merge pull request #1347 from anoma/tiago/ethbridge/warn-valset-upd-r…
sug0 May 11, 2023
f1d1c75
Add safe mode to bridge pool relays
sug0 May 11, 2023
2cbfc7a
fixup! Pretty print error msgs
sug0 May 11, 2023
2e1b7bd
Merge pull request #1351 from anoma/tiago/ethbridge/warn-bp-transfer-3
sug0 May 11, 2023
f88197d
Factor out `TimeoutStrategy::run`
sug0 May 11, 2023
0c09bfb
WIP: Keep oracle running if Eth node is still available
sug0 May 11, 2023
fbeb175
Rename TimeoutStrategy to SleepStrategy
sug0 May 11, 2023
2f8c723
Fix docstr
sug0 May 11, 2023
1a3a30b
Factor out eth_syncing_status_timeout()
sug0 May 11, 2023
321b538
Misc fixes
sug0 May 11, 2023
99e1f65
Use `hints::unlikely` for oracle errors
sug0 May 11, 2023
70b9823
Merge remote-tracking branch 'namada/yuji/ibc-cleanup' (#1217) into main
juped May 11, 2023
33c7696
Merge remote-tracking branch 'namada/tomas/nested-lazy-vec-iter' (#12…
juped May 11, 2023
4fe7909
Merge remote-tracking branch 'namada/tomas/overflow-check-in-release'…
juped May 11, 2023
e1b6c10
Merge remote-tracking branch 'namada/tomas/update-proptest-sm' (#1304…
juped May 11, 2023
d6d30e6
Merge remote-tracking branch 'namada/fraccaman/pk-to-tm' (#1152) into…
juped May 11, 2023
1982cbd
Merge remote-tracking branch 'namada/fraccaman/base-directory' (#1138…
juped May 11, 2023
390bf3f
Merge remote-tracking branch 'namada/tomas+brent/fix_update_data_epoc…
juped May 11, 2023
212f3bf
Merge remote-tracking branch 'namada/yuji/enable_wal_batch' (#1333) i…
juped May 11, 2023
f2d1fa4
Merge remote-tracking branch 'namada/yuji/ibc-cleanup' (#1217) into m…
juped May 11, 2023
00c178b
Merge remote-tracking branch 'namada/tomas/nested-lazy-vec-iter' (#12…
juped May 11, 2023
0e782ff
Merge remote-tracking branch 'namada/tomas/overflow-check-in-release'…
juped May 11, 2023
89036f1
Merge remote-tracking branch 'namada/tomas/update-proptest-sm' (#1304…
juped May 11, 2023
d5e854d
Merge remote-tracking branch 'namada/fraccaman/pk-to-tm' (#1152) into…
juped May 11, 2023
5d187f0
Merge remote-tracking branch 'namada/fraccaman/base-directory' (#1138…
juped May 11, 2023
40f1d90
Merge remote-tracking branch 'namada/tomas+brent/fix_update_data_epoc…
juped May 11, 2023
8f4a21f
Merge remote-tracking branch 'namada/yuji/enable_wal_batch' (#1333) i…
juped May 11, 2023
0060e0f
Namada 0.15.2
juped May 11, 2023
005b539
Sync with 0.15.2
juped May 12, 2023
f8cf007
fix: base ledger location
Fraccaman May 12, 2023
07d533b
fix: format
Fraccaman May 12, 2023
f7a67dc
Merge pull request #1357 from anoma/fraccaman/fix-home-folder-change-…
bengtlofgren May 12, 2023
2b8fc76
Merge pull request #1029 from anoma/bengt/docs-quickfix
adrianbrink May 12, 2023
df33bc1
Merge pull request #1148 from anoma/ray/cargo-release-0.24.4
adrianbrink May 12, 2023
b2bcf3b
Merge pull request #1317 from anoma/tomas/update-contrib
adrianbrink May 12, 2023
ad079e7
Drain the commands channel of the test oracle
sug0 May 12, 2023
4003df3
Merge branch 'main' into cwgoes/more-specs-work
cwgoes May 12, 2023
5dd5bb3
Fix docstring
sug0 May 12, 2023
ed5e2d9
Merge pull request #1352 from anoma/tiago/ethbridge/oracle-ping
sug0 May 12, 2023
3ccbf10
Merge pull request #1100 from anoma/cwgoes/more-specs-work
cwgoes May 12, 2023
add8ab6
WIP: Relayer error priorities
sug0 May 12, 2023
c1335be
Remove priorities
sug0 May 12, 2023
64eafda
changed the base dir where i could find it
bengtlofgren May 12, 2023
7dcc9b1
more places
bengtlofgren May 12, 2023
8e830ef
Merge pull request #1364 from anoma/bengt/base-dir-docs
bengtlofgren May 12, 2023
f807229
apps/config: use blank domain and organization
juped May 13, 2023
eddc321
apps/config: upcase "Namada" for data directories
juped May 13, 2023
7d583d9
Bump rocksdb to v0.21.0
mariari May 13, 2023
418378c
apps/config: use non-roaming profile on Windows
juped May 13, 2023
5367af8
apps/cli: update default data dirs in cli help
juped May 13, 2023
ec05cd4
changelog: add #1366
juped May 15, 2023
d86f3d1
changelog: add #1369
juped May 15, 2023
02a3345
changelog: add #1368
juped May 15, 2023
6e17ef7
Merge remote-tracking branch 'namada/mariari/bump-rocksdb' (#1366) in…
juped May 15, 2023
bc3c5a2
Merge remote-tracking branches 'namada/ray/base-directory-windows-loc…
juped May 15, 2023
a0eadb9
Merge branches 'ray/base-directory-windows-local' (#1368) and 'ray/ba…
juped May 15, 2023
f7b7e3b
Namada 0.15.3
juped May 15, 2023
50cce96
Reduce valset upd relayer daemon log output
sug0 May 15, 2023
a2dae7c
Merge pull request #1377 from anoma/tiago/ethbridge/silence-relayer-logs
sug0 May 15, 2023
e2bc74b
fixing docs
bengtlofgren May 15, 2023
462186b
changelog: correct #1138
juped May 15, 2023
8b79589
Sync with 0.15.3
juped May 15, 2023
7283bb3
docs are now up to date
bengtlofgren May 15, 2023
7141462
Implement CLI command to delete a storage value
sug0 May 15, 2023
7d56535
Fix docstr
sug0 May 15, 2023
a46abb0
Run e2e test from existing test dir
sug0 May 15, 2023
a4588e3
Update documentation/docs/src/user-guide/ledger.md
bengtlofgren May 15, 2023
93ec5c1
Update documentation/docs/src/user-guide/ledger.md
bengtlofgren May 15, 2023
6813791
Add borrowed data param to rpc_client_do
sug0 May 15, 2023
b4ca1f6
Merge pull request #1379 from anoma/bengt/base-dir-docs3
bengtlofgren May 15, 2023
5012086
new chain id added
bengtlofgren May 15, 2023
4587bb1
Merge pull request #1381 from anoma/bengt/testnet-8-docs
bengtlofgren May 15, 2023
03f1576
docs/dev: add mdbook-pagetoc plugin
tzemanovic Apr 4, 2023
8df2d13
CI/docs: add mdbook-pagetoc
tzemanovic Apr 4, 2023
d9b419a
changelog: add #1275
tzemanovic Apr 4, 2023
6445f48
Merge remote-tracking branch 'namada/tomas/docs/dev/pagetoc' (#1275) …
juped May 15, 2023
0641897
Allow user data other than refs in rpc requests for e2e tests
sug0 May 15, 2023
53011c2
Add test_submit_validator_set_udpate() e2e test
sug0 May 15, 2023
17fcfaf
Merge pull request #1383 from anoma/tiago/ethbridge/offline-valset-upd-2
sug0 May 16, 2023
7dee1b1
Add Ethereum start height parameter key
sug0 May 16, 2023
8f107b2
Make eth block height types serde serializable
sug0 May 16, 2023
0509fd9
Add eth start height to gov params
sug0 May 16, 2023
92c64ae
Add missing fields to eth bridge config
sug0 May 16, 2023
6a1b43c
Convert BlockHeight to a tuple struct
sug0 May 16, 2023
9029dc9
Get initial eth start height from gov param
sug0 May 17, 2023
ed9e814
Update the Ethereum bridge specs
sug0 May 17, 2023
85bb53d
Merge pull request #1385 from anoma/tiago/ethbridge/oracle-start-height
sug0 May 17, 2023
31499f2
apps/wallet: restore show_overwrite_confirmation
juped May 15, 2023
2bf55e4
wallet: add forcible alias overwriting options
juped May 15, 2023
975c035
Merge branch 'mariari/shared-sdk-integration' (#925) into main
juped May 17, 2023
e296df4
Merge branch 'ray/sdk-wallet-force' (#1380) into main
juped May 17, 2023
be403f7
Namada 0.16.0
juped May 17, 2023
b4663da
Merge v0.14.2
sug0 May 19, 2023
76c4332
Fix unit tests
sug0 May 19, 2023
aef3f61
Merge v0.14.3
sug0 May 19, 2023
5684905
Changes from v0.15.0
sug0 May 19, 2023
66f381f
Merge tag 'v0.15.0' into tiago/ethbridge/v0.15.0
batconjurer May 19, 2023
bea290a
Run make fmt
sug0 May 20, 2023
a05f1fb
Fix static lifetime bounds
sug0 May 20, 2023
092f917
Add back `setup_at_height`
sug0 May 20, 2023
3af4248
Fix shell setup calls
sug0 May 20, 2023
4dd55d6
Fix test wrong chain id
sug0 May 20, 2023
d8672dd
WIP: Adding chain id to txs
sug0 May 20, 2023
5730b93
Fix ProcessProposal wrapper tx checks
sug0 May 20, 2023
bab1caf
Include block timestamp in process txs
sug0 May 20, 2023
5acd09e
Fix type of FinalizeBlock protocol txs match expr
sug0 May 20, 2023
749b330
Fix dev mode genesis
sug0 May 20, 2023
3451eae
A bunch of Tx instantiation fixes
sug0 May 20, 2023
7990b94
Import related fixes
sug0 May 20, 2023
f8b3fe5
Rename: apply_tx -> dispatch_tx
sug0 May 20, 2023
4a53a11
Add missing parameter in InitChain
sug0 May 20, 2023
b7150a6
Create temporary writelog storage
sug0 May 20, 2023
15e6f23
Rename: wrapper_tx -> wrapper
sug0 May 20, 2023
3595b13
Add back missing unit tests
sug0 May 20, 2023
386c14b
Change type visibility
sug0 May 20, 2023
6169061
Remove unnecessary refs
sug0 May 20, 2023
12b4e11
Fix e2e test imports
sug0 May 20, 2023
60060a8
Fixing tests
sug0 May 20, 2023
ba4a75b
Update Cargo lock files
sug0 May 20, 2023
1389ac9
Fix wasm
sug0 May 20, 2023
7834521
Fix test_validate_valset_upd_vexts() unit test
sug0 May 20, 2023
c8852a3
Implement `TestShell` util to advance to the next epoch
sug0 May 20, 2023
60fcf4a
Refactor valset upd test to use `TestShell::start_new_epoch`
sug0 May 21, 2023
6d6996d
Fix chain id test
sug0 May 21, 2023
4df89ab
Fix test_must_send_valset_upd
sug0 May 21, 2023
036ff5e
Fix some vote extension unit tests
sug0 May 21, 2023
9b9be49
Use error codes in CheckTx
sug0 May 21, 2023
c094ef5
Fix test_wrong_tx_type
sug0 May 21, 2023
4f7b5e2
Fix test_replay_attack
sug0 May 21, 2023
35d1170
Fix test_mempool_filter_protocol_txs_bridge_inactive
sug0 May 21, 2023
8920c5c
Fix test_mempool_rejects_invalid_tx
sug0 May 21, 2023
9f45f13
Fix test_mempool_rejects_invalid_tx
sug0 May 21, 2023
b4d506f
Fix test_inflation_accounting
sug0 May 21, 2023
7af1227
Fix test_prepare_proposal_vext_insufficient_voting_power
sug0 May 21, 2023
bdf2387
Fix wrapper tx timestamp checks
sug0 May 21, 2023
1a76e03
Fix make file target
sug0 May 21, 2023
577d4bf
Fix pattern matching in unit tests
sug0 May 21, 2023
9d4737a
Merge v0.15.3
sug0 May 22, 2023
f98f467
Remove ABCI++ deps
sug0 May 22, 2023
4ff1be5
Run make fmt
sug0 May 22, 2023
8b47cd4
Add missing merkle tree import
sug0 May 22, 2023
6b2ad8c
Debug impls for storage hashers
sug0 May 22, 2023
ed68b93
Remove unused import
sug0 May 22, 2023
cc5da43
Commit block fixes on tests
sug0 May 22, 2023
a27fb10
IBC event fixes
sug0 May 22, 2023
6b52fdd
Add missing Eth keys to IBC test
sug0 May 22, 2023
db289c8
Add new Hash methods
sug0 May 22, 2023
1ad6a94
Hash fixes
sug0 May 22, 2023
d0cdca8
Import fixes
sug0 May 23, 2023
fd805e3
Fix InitChain
sug0 May 23, 2023
8d55092
RocksDB fixes
sug0 May 23, 2023
da119bc
Fix e2e test
sug0 May 23, 2023
b5e8df4
Update Cargo lock files
sug0 May 23, 2023
fc353b6
Merge v0.16.0
sug0 May 24, 2023
0f29369
Move timeouts to shared
sug0 May 25, 2023
cfd5120
Remove tokio as a dep from shared
sug0 May 25, 2023
dc49206
Make timeouts mechanism compatible with the browser wasm engine
sug0 May 25, 2023
5a16d7c
Update Cargo lock file
sug0 May 25, 2023
890f59e
Remove duped rand dependency
sug0 May 25, 2023
473d705
Run make fmt
sug0 May 25, 2023
804e255
Remove extra CLI flag
sug0 May 25, 2023
2de5b68
Remove submit valset upd cmd
sug0 May 25, 2023
c8bc6bf
Remove db delete value
sug0 May 25, 2023
26b54cf
SDK-ize commands from `apps` to `shared`
sug0 May 25, 2023
666acba
WIP: Platform specific shutdown signal
sug0 May 29, 2023
0ac702c
Move control flow stuff to shared
sug0 May 29, 2023
e2144a1
Platform specific timeouts
sug0 May 29, 2023
872d7ff
Implement sleep method
sug0 May 29, 2023
ad988ae
Rename module from timeouts to time
sug0 May 29, 2023
7ea1d06
WIP: Removing tokio calls from shared
sug0 May 29, 2023
9ad287b
Update Cargo lock file
sug0 May 29, 2023
5ed4d71
Continue to SDK-ize former CLI commands
sug0 May 31, 2023
603465c
Add new control flow abstractions
sug0 May 31, 2023
c5767ce
Use new control flow abstractions
sug0 May 31, 2023
e87e0ea
Fixing a bunch of silly errors
sug0 Jun 1, 2023
dd12c3c
More silly shit
sug0 Jun 1, 2023
4e276a6
Make shutdown signal a concrete type
sug0 Jun 1, 2023
ec14360
Fixes to `shared`
sug0 Jun 1, 2023
dfde5a7
Fixes
sug0 Jun 1, 2023
5191ba3
More fixes :|
sug0 Jun 1, 2023
9ce30cb
Take a Tendermint address from a mem slot
sug0 Jun 2, 2023
965b6d8
Remove ctx from some sdk args conversions
sug0 Jun 2, 2023
d9cc529
Fix CLI
sug0 Jun 2, 2023
5313e9a
Fix compiler errors in tests
sug0 Jun 2, 2023
1e6be89
Update Cargo lock files in wasms
sug0 Jun 2, 2023
24f05f5
Fix `make build-debug`
sug0 Jun 2, 2023
885ed01
Import build devnet script from main
sug0 Jun 2, 2023
a6afa37
Do not block on signal receiving
sug0 Jun 5, 2023
9eea44e
Replace test oracle command sender
sug0 Jun 5, 2023
05b953f
Fix tests ending prematurely
sug0 Jun 5, 2023
5f0293e
Merge pull request #1442 from anoma/tiago/ethbridge/merge
sug0 Jun 5, 2023
0912ed0
Do not ignore control flows in the CLI
sug0 Jun 6, 2023
7227b48
Merge pull request #1515 from anoma/tiago/ethbridge/use-control-flows
sug0 Jun 6, 2023
4d94180
Add new Halt method
sug0 Jun 6, 2023
4e70077
Refactor query_tx_status
sug0 Jun 6, 2023
7e917bb
Remove unused query_tx_status in apps
sug0 Jun 6, 2023
78794a1
Add error bounds to client
sug0 Jun 6, 2023
cad8e47
Refactor SleepStrategy to include retry method
sug0 Jun 6, 2023
581e78a
Refactor sleep strategy to allow custom states
sug0 Jun 6, 2023
c2b3e01
Refactor fixes
sug0 Jun 6, 2023
ee68ce1
Refactor wait_until_node_is_synched
sug0 Jun 6, 2023
a4d7a85
Remove sketchy code from timeouts
sug0 Jun 6, 2023
c74c585
Remove timeout defaults
sug0 Jun 6, 2023
ac2a72c
Remove async-std from shared
sug0 Jun 7, 2023
103c752
Add map to sleep strategy
sug0 Jun 7, 2023
18e944d
Allow ExponentialBackoff to capture env
sug0 Jun 7, 2023
1125539
Refactor wasm compilation cache sleep to use ExponentialBackoff
sug0 Jun 7, 2023
ffa4472
Merge pull request #1519 from anoma/tiago/ethbridge/timeout-refactor
sug0 Jun 7, 2023
80e8940
Remove web30 dep on shared
sug0 Jun 7, 2023
5e25837
Refactor relayer to use generic ethers middleware
sug0 Jun 7, 2023
9ae6b6b
Remove tokio's LocalSet dep in shared
sug0 Jun 7, 2023
b50692a
Remove ShouldRelay tokio dep
sug0 Jun 7, 2023
97264a2
Remove needless heap alloc
sug0 Jun 7, 2023
0944b49
Remove needless lifetimes
sug0 Jun 8, 2023
42197a7
Add generic geth rpc client for the eth oracle
sug0 Jun 9, 2023
a79d12c
Purge weird test cfg-flags for the Ethereum oracle
sug0 Jun 9, 2023
569910e
Fix CLI args
sug0 Jun 9, 2023
dc4daa8
Remove comments
sug0 Jun 9, 2023
62974ec
Update wasm Cargo lock files
sug0 Jun 9, 2023
2af5e95
Remove web30 deps from Cargo files
sug0 Jun 9, 2023
829f53f
Start removing web30 dep from apps
sug0 Jun 9, 2023
dc6576e
Implement RpcClient with ethers
sug0 Jun 9, 2023
f1e5f59
User shutdown is not a fatal error
sug0 Jun 9, 2023
364f2df
Re-order instant query since a tokio watch chan borrow can block
sug0 Jun 9, 2023
955caf3
Erase Eth RPC address from SDK types
sug0 Jun 12, 2023
2c5ae39
Merge pull request #1531 from anoma/tiago/ethbridge/web-compat
sug0 Jun 12, 2023
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
35 changes: 21 additions & 14 deletions Cargo.lock

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

11 changes: 6 additions & 5 deletions apps/Cargo.toml
Original file line number Diff line number Diff line change
@@ -98,11 +98,11 @@ data-encoding = "2.3.2"
derivative = "2.2.0"
ed25519-consensus = "1.2.0"
ethabi = "18.0.0"
ethbridge-bridge-contract = {git = "https://github.com/heliaxdev/ethbridge-rs", tag = "v0.17.0"}
ethbridge-bridge-events = {git = "https://github.com/heliaxdev/ethbridge-rs", tag = "v0.17.0"}
ethbridge-events = {git = "https://github.com/heliaxdev/ethbridge-rs", tag = "v0.17.0"}
ethbridge-governance-contract = {git = "https://github.com/heliaxdev/ethbridge-rs", tag = "v0.17.0"}
ethbridge-governance-events = {git = "https://github.com/heliaxdev/ethbridge-rs", tag = "v0.17.0"}
ethbridge-bridge-contract = {git = "https://github.com/heliaxdev/ethbridge-rs", tag = "v0.18.0"}
ethbridge-bridge-events = {git = "https://github.com/heliaxdev/ethbridge-rs", tag = "v0.18.0"}
ethbridge-events = {git = "https://github.com/heliaxdev/ethbridge-rs", tag = "v0.18.0"}
ethbridge-governance-contract = {git = "https://github.com/heliaxdev/ethbridge-rs", tag = "v0.18.0"}
ethbridge-governance-events = {git = "https://github.com/heliaxdev/ethbridge-rs", tag = "v0.18.0"}
ferveo = {git = "https://github.com/anoma/ferveo", rev = "9e5e91c954158e7cff45c483fd06cd649a81553f"}
ferveo-common = {git = "https://github.com/anoma/ferveo", rev = "9e5e91c954158e7cff45c483fd06cd649a81553f"}
eyre = "0.6.5"
@@ -120,6 +120,7 @@ num-traits = "0.2.14"
num_cpus = "1.13.0"
once_cell = "1.8.0"
orion = "0.16.0"
owo-colors = "3.5.0"
parse_duration = "2.1.1"
prost = "0.9.0"
prost-types = "0.9.0"
59 changes: 44 additions & 15 deletions apps/src/lib/client/eth_bridge/bridge_pool.rs
Original file line number Diff line number Diff line change
@@ -16,6 +16,8 @@ use namada::types::eth_bridge_pool::{
};
use namada::types::keccak::KeccakHash;
use namada::types::token::Amount;
use namada::types::voting_power::FractionalVotingPower;
use owo_colors::OwoColorize;
use serde::{Deserialize, Serialize};
use tokio::time::{Duration, Instant};

@@ -159,20 +161,27 @@ async fn construct_bridge_pool_proof(
.unwrap();

let warnings: Vec<_> = in_progress
.keys()
.filter_map(|k| {
let hash = PendingTransfer::from(k).keccak256();
transfers.contains(&hash).then_some(hash)
.into_iter()
.filter_map(|(ref transfer, voting_power)| {
if voting_power > FractionalVotingPower::ONE_THIRD {
let hash = PendingTransfer::from(transfer).keccak256();
transfers.contains(&hash).then_some(hash)
} else {
None
}
})
.collect();

if !warnings.is_empty() {
let warning = "Warning".on_yellow();
let warning = warning.bold();
let warning = warning.blink();
println!(
"\x1b[93mWarning: The following hashes correspond to transfers \
\nthat have been relayed but do not yet have a quorum of \
\nvalidator signatures; thus they are still in the bridge \
pool:\n\x1b[0m{:?}",
warnings
"{warning}: The following hashes correspond to transfers that \
have surpassed the security threshold in Namada, therefore have \
likely been relayed, but do not yet have a quorum of validator \
signatures behind them; thus they are still in the Bridge \
pool:\n{warnings:?}",
);
print!("\nDo you wish to proceed? (y/n): ");
std::io::stdout().flush().unwrap();
@@ -278,12 +287,15 @@ pub async fn relay_bridge_pool_proof(args: args::RelayBridgePoolProof) {
.await
{
Ok(address) => Bridge::new(address.address, eth_client),
error => {
Err(err_msg) => {
let error = "Error".on_red();
let error = error.bold();
let error = error.blink();
println!(
"Failed to retreive the Ethereum Bridge smart contract \
address from storage with reason:\n{:?}\n\nPerhaps the \
Ethereum bridge is not active.",
error
"{error}: Failed to retrieve the Ethereum Bridge smart \
contract address from storage with \
reason:\n{err_msg}\n\nPerhaps the Ethereum bridge is not \
active.",
);
safe_exit(1)
}
@@ -297,6 +309,24 @@ pub async fn relay_bridge_pool_proof(args: args::RelayBridgePoolProof) {
}
};

// NOTE: this operation costs no gas on Ethereum
let contract_nonce =
bridge.transfer_to_erc_20_nonce().call().await.unwrap();

if contract_nonce != bp_proof.batch_nonce {
let warning = "Warning".on_yellow();
let warning = warning.bold();
let warning = warning.blink();
println!(
"{warning}: The Bridge pool nonce in the smart contract is \
{contract_nonce}, while the nonce in Namada is still {}. A relay \
of the former one has already happened, but a proof has yet to \
be crafted in Namada.",
bp_proof.batch_nonce
);
safe_exit(1)
}

let mut relay_op = bridge.transfer_to_erc(bp_proof);
if let Some(gas) = args.gas {
relay_op.tx.set_gas(gas);
@@ -325,7 +355,6 @@ mod recommendations {
use namada::types::vote_extensions::validator_set_update::{
EthAddrBook, VotingPowersMap, VotingPowersMapExt,
};
use namada::types::voting_power::FractionalVotingPower;

use super::*;
const TRANSFER_FEE: i64 = 37_500;
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ data-encoding = "2.3.2"
derivative = "2.2.0"
ed25519-consensus = "1.2.0"
ethabi = "18.0.0"
ethbridge-structs = { git = "https://github.com/heliaxdev/ethbridge-rs", tag = "v0.17.0" }
ethbridge-structs = { git = "https://github.com/heliaxdev/ethbridge-rs", tag = "v0.18.0" }
eyre = "0.6.8"
ferveo = {optional = true, git = "https://github.com/anoma/ferveo", rev = "9e5e91c954158e7cff45c483fd06cd649a81553f"}
ferveo-common = {git = "https://github.com/anoma/ferveo", rev = "9e5e91c954158e7cff45c483fd06cd649a81553f"}
23 changes: 21 additions & 2 deletions shared/src/ledger/queries/shell/eth_bridge.rs
Original file line number Diff line number Diff line change
@@ -365,8 +365,8 @@ where
..Default::default()
})
}
Ok(_) => unreachable!(),
Err(e) => Err(storage_api::Error::new(e)),
_ => unreachable!(),
}
} else {
Err(storage_api::Error::SimpleMessage(
@@ -404,10 +404,25 @@ where
}
})
{
// we checked above that key is not empty, so this write is fine
*key.segments.last_mut().unwrap() =
DbKeySeg::StringSeg(Keys::segments().seen.into());
// check if the event has been seen
let is_seen = ctx
.wl_storage
.read::<bool>(&key)
.into_storage_result()?
.expect(
"Iterating over storage should not yield keys without values.",
);
if is_seen {
continue;
}

if let Ok(EthereumEvent::TransfersToEthereum { transfers, .. }) =
EthereumEvent::try_from_slice(&value)
{
// We checked above that key is not empty
// read the voting power behind the event
*key.segments.last_mut().unwrap() =
DbKeySeg::StringSeg(Keys::segments().voting_power.into());
let voting_power = ctx
@@ -1206,6 +1221,10 @@ mod test_ethbridge_router {
.expect("Test failed"),
)
.expect("Test failed");
client
.wl_storage
.write(&eth_msg_key.seen(), false)
.expect("Test failed");
// commit the changes and increase block height
client
.wl_storage
4 changes: 2 additions & 2 deletions wasm/Cargo.lock

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

4 changes: 2 additions & 2 deletions wasm_for_tests/wasm_source/Cargo.lock

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