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

Fix the Ethereum Bridge VP #1855

Merged
merged 103 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
9ec1833
Add Eth whitelist storage keys
sug0 Jul 11, 2023
ed2afb2
Add Eth whitelist key tests
sug0 Jul 11, 2023
6ca25fd
Add non-usable tokens for Ethereum bridge protocol bookkeeping
sug0 Jul 11, 2023
5208f3d
Add a VP for NUT transfers
sug0 Jul 11, 2023
9c14b65
Test NUT VP
sug0 Jul 12, 2023
4901296
Trigger the NUT native VP
sug0 Jul 12, 2023
9b6df79
Update ethbridge-rs to v0.19.0
sug0 Jul 12, 2023
b932890
Add transfer to Ethereum kinds (ERC20 or NUT)
sug0 Jul 12, 2023
8297842
Mint NUTs upon receiving non-whitelisted assets or exceeding token caps
sug0 Jul 12, 2023
82320aa
Add helper fn to whitelist tokens in tests
sug0 Jul 12, 2023
1a70c4f
Fix unit tests requiring token whitelist checks
sug0 Jul 12, 2023
339e18a
Fix refunding and burning of NUTs
sug0 Jul 12, 2023
d115bb0
Rework DAI minting unit tests to account for NUTs
sug0 Jul 13, 2023
d26e983
Test burning NUTs
sug0 Jul 13, 2023
8de897d
Check NUT escrow in Bridge pool VP
sug0 Jul 14, 2023
a839866
Test NUTs in the Bridge pool
sug0 Jul 14, 2023
180c986
Add NUT cmdline flag for Bridge pool transfers
sug0 Jul 12, 2023
7732e24
Update ethbridge-rs to v0.20.0
sug0 Jul 13, 2023
92bb87f
Remove whitelist Ethereum events from the ledger
sug0 Jul 13, 2023
a1213c7
Add whitelisted ERC20 tokens to the genesis file
sug0 Jul 13, 2023
4777038
Update ethbridge-rs to v0.21.0
sug0 Jul 15, 2023
cde9503
Move ethbridge-rs deps to the workspace
sug0 Jul 31, 2023
20044d0
Add changelog entry for the Ethereum token whitelist
sug0 Jul 31, 2023
2ae23fb
Add helper methods to EthAssetMint
sug0 Aug 1, 2023
f1be3f9
Use EthAssetMint helper methods
sug0 Aug 1, 2023
6ef086f
Refactor redeem_native_token to use update::amount
sug0 Aug 1, 2023
f1bd957
Vet Ethereum bridge config of the native token
sug0 Aug 1, 2023
69037fb
Harden Bridge pool VP against wNAM NUT transfers
sug0 Aug 1, 2023
a26de50
Update wNAM supplies when acting on Ethereum events
sug0 Aug 1, 2023
c67a656
Allow null pre-balances during Bridge pool escrow checks
sug0 Aug 1, 2023
d3a4906
Flow control of NAM transferred to Ethereum
sug0 Aug 2, 2023
99fe477
Replace ERC20 supply RPC query with atomic read of all flow control data
sug0 Aug 2, 2023
2861e46
Refactor get_erc20_flow_control to use EthBridgeQueries
sug0 Aug 2, 2023
14556d7
Add test_wnam_doesnt_mint_nuts() unit test
sug0 Aug 2, 2023
7efe3c2
Fix test_wrapped_nam_not_burned() unit test
sug0 Aug 2, 2023
a714fb3
Fix test_redeem_native_token() unit test
sug0 Aug 2, 2023
0655085
Test that wrapped NAM is never minted
sug0 Aug 3, 2023
7a53732
Fix test_act_on_changes_storage_for_transfers_to_eth() unit test
sug0 Aug 2, 2023
c0b0ed5
Refactor Bridge pool tests to allow modifying pending transfer
sug0 Aug 2, 2023
d704d86
Add `asset` field to Balance
sug0 Aug 3, 2023
d90a5ea
New Bridge pool VP unit tests for wrapped NAM
sug0 Aug 3, 2023
75cf448
Fix wNAM edge cases in Bridge pool VP unit tests
sug0 Aug 3, 2023
fd1bf4d
Add invalidate_wnam_over_cap_tx() unit test
sug0 Aug 8, 2023
161cf43
Add changelog for #1781
sug0 Aug 3, 2023
b30a877
Update ethbridge-rs to v0.22.0
sug0 Aug 3, 2023
1a63f01
Fix compilation errors to support new `ethbridge-rs`
sug0 Aug 3, 2023
91b2fef
Test pending transfers and events have the same ABI encoding
sug0 Aug 7, 2023
5678ee7
Changelog for #1789
sug0 Aug 7, 2023
28dad92
Move `check_balance_changes` to Bridge pool VP module
sug0 Aug 8, 2023
e102aff
Add token addr field to Bridge pool gas fees
sug0 Aug 8, 2023
b30fbeb
Fix compilation errors from prev commit
sug0 Aug 8, 2023
1850b07
Check correct gas fee token in Bridge pool transfers
sug0 Aug 8, 2023
bbff3cc
Validate different gas fee tokens in Bridge pool VP
sug0 Aug 8, 2023
fdf00a8
Fix test_minting_wnam() unit test
sug0 Aug 8, 2023
7ec76d9
Add misc Bridge pool VP tests
sug0 Aug 9, 2023
5c8a030
Fix bug in `determine_escrow_checks` and document corner cases
sug0 Aug 9, 2023
bad6a7c
Arbitrary gas fees in Ethereum events `init_balances`
sug0 Aug 10, 2023
8745546
Test paying Bridge pool gas fees in ERC20 tokens
sug0 Aug 10, 2023
9c3fbcc
Update CLI args for Bridge pool transfers
sug0 Aug 8, 2023
4091b55
Standardize Bridge pool transfer CLI args
sug0 Aug 8, 2023
5342193
Make Bridge pool gas payer CLI arg optional
sug0 Aug 8, 2023
ce21ebd
Fix docstring
sug0 Aug 11, 2023
ba741a5
Add `DenominatedAmount::is_zero`
sug0 Aug 11, 2023
27f07c8
Fix the denomination of Bridge pool gas fees
sug0 Aug 11, 2023
968f1a6
Changelog for #1795
sug0 Aug 9, 2023
ee8cdb2
Retrieve the inner raw string on wrapped context values
sug0 Aug 11, 2023
7a56f84
Bridge pool conversion rates table
sug0 Aug 11, 2023
3a15876
Convert gwei to tokens in Bridge pool conversion table
sug0 Aug 11, 2023
d1ac064
Fix Bridge pool `construct_proof`
sug0 Aug 14, 2023
11aef0c
Add context to CLI Bridge pool cmds
sug0 Aug 14, 2023
5898fb3
Refactor recommendations to use EligibleRecommendation
sug0 Aug 16, 2023
4eae738
Rename `generate` to `generate_recommendations`
sug0 Aug 16, 2023
0fc3e5d
Fix Bridge pool proof warning voting power
sug0 Aug 16, 2023
ed3b5a3
Factor out `generate_eligible()`
sug0 Aug 16, 2023
fb89bff
Improve conversion rate query
sug0 Aug 16, 2023
ad57fab
Avoid overflowing when calculating earned gwei amount
sug0 Aug 16, 2023
3701ff7
Add test_generate_eligible_happy_path() unit test
sug0 Aug 16, 2023
bf1a3be
Abstract `generate_eligible` unit tests with a helper fn
sug0 Aug 16, 2023
e7fa5ee
More conversion table unit tests
sug0 Aug 16, 2023
1b0dfee
Prohibit generating BP proofs when the signed root is outdated
sug0 Aug 16, 2023
a0f5852
Fail recommending BP batch of txs if nonce is out of date
sug0 Aug 17, 2023
371b1fe
Store height when BP root was signed
sug0 Aug 17, 2023
7b29efd
Check BP root's height when vote extension was signed
sug0 Aug 17, 2023
00a859a
Test the height of the BP proof stored in the db
sug0 Aug 17, 2023
ac5d3ac
Return recommendation data in `generate_recommendations`
sug0 Aug 18, 2023
b2a1e95
Proper Debug impl for I256 values
sug0 Aug 18, 2023
eff9785
Add test_conversion_table_profit_margin() unit test
sug0 Aug 18, 2023
225c885
Ignore invalid conversion rates
sug0 Aug 18, 2023
c4e4819
Add changelog for #1811
sug0 Aug 14, 2023
655601c
Split Bridge pool transfer hashes on all whitespace toks
sug0 Aug 25, 2023
9a5988c
Changelog for #1851
sug0 Aug 29, 2023
ecc5e86
Update ethbridge-rs to v0.23.0
sug0 Aug 22, 2023
305598e
Fix Ethereum oracle tests
sug0 Aug 28, 2023
9a0320c
Changelog for #1852
sug0 Aug 29, 2023
5c380da
Translate NUT denoms to ERC20 denoms
sug0 Aug 23, 2023
4ce6079
Changelog for #1853
sug0 Aug 29, 2023
28e039a
Iterate over all addrs in a storage key
sug0 Aug 23, 2023
2831992
hotfix: Add NUT native VP as a verifier
sug0 Aug 23, 2023
bfc99e7
Changelog for #1854
sug0 Aug 29, 2023
6029783
Introduce `has_eth_addr_segment()` storage key predicate
sug0 Aug 24, 2023
4c76977
Refactor the Ethereum bridge native VP
sug0 Aug 24, 2023
b348bde
Allow an arbitrary nr of accounts to transfer to the Eth bridge addr
sug0 Aug 24, 2023
f63d364
Changelog for #1855
sug0 Aug 29, 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fix the decoding of events observed by the Ethereum oracle
([\#1852](https://github.com/anoma/namada/pull/1852))
2 changes: 2 additions & 0 deletions .changelog/unreleased/bug-fixes/1854-hotfix-trigger-nut-vp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Trigger the NUT VP when NUTs are moved between accounts during wasm
transaction execution ([\#1854](https://github.com/anoma/namada/pull/1854))
2 changes: 2 additions & 0 deletions .changelog/unreleased/bug-fixes/1855-fix-ethbridge-vp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fix the Ethereum Bridge VP
([\#1855](https://github.com/anoma/namada/pull/1855))
2 changes: 2 additions & 0 deletions .changelog/unreleased/features/1290-token-whitelist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Implement Ethereum token whitelist.
([\#1290](https://github.com/anoma/namada/issues/1290))
2 changes: 2 additions & 0 deletions .changelog/unreleased/features/1781-cap-wnam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Control the flow of NAM over the Ethereum bridge
([\#1781](https://github.com/anoma/namada/pull/1781))
2 changes: 2 additions & 0 deletions .changelog/unreleased/features/1789-update-ethbridge-rs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Update ethbridge-rs to v0.22.0
([\#1789](https://github.com/anoma/namada/pull/1789))
2 changes: 2 additions & 0 deletions .changelog/unreleased/features/1795-bridge-pool-fees.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Allow Bridge pool transfer fees to be paid in arbitrary token types (except
NUTs) ([\#1795](https://github.com/anoma/namada/pull/1795))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Added various fee types to the output of the Bridge pool recommendations RPC
([\#1811](https://github.com/anoma/namada/pull/1811))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Split Bridge pool transfer hashes on all whitespace toks
([\#1851](https://github.com/anoma/namada/pull/1851))
2 changes: 2 additions & 0 deletions .changelog/unreleased/improvements/1853-nut-denom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Denominate non-whitelisted NUT amounts
([\#1853](https://github.com/anoma/namada/pull/1853))
25 changes: 12 additions & 13 deletions Cargo.lock

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

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ directories = "4.0.1"
ed25519-consensus = "1.2.0"
escargot = "0.5.7"
ethabi = "18.0.0"
ethbridge-bridge-contract = {git = "https://github.com/heliaxdev/ethbridge-rs", tag = "v0.23.0"}
ethbridge-bridge-events = {git = "https://github.com/heliaxdev/ethbridge-rs", tag = "v0.23.0"}
ethbridge-events = {git = "https://github.com/heliaxdev/ethbridge-rs", tag = "v0.23.0"}
ethbridge-governance-contract = {git = "https://github.com/heliaxdev/ethbridge-rs", tag = "v0.23.0"}
ethbridge-governance-events = {git = "https://github.com/heliaxdev/ethbridge-rs", tag = "v0.23.0"}
ethbridge-structs = { git = "https://github.com/heliaxdev/ethbridge-rs", tag = "v0.23.0" }
ethers = "2.0.0"
expectrl = "0.7.0"
eyre = "0.6.5"
Expand Down
6 changes: 3 additions & 3 deletions apps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ derivative.workspace = true
directories.workspace = true
ed25519-consensus.workspace = true
ethabi.workspace = true
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-events = {git = "https://github.com/heliaxdev/ethbridge-rs", tag = "v0.18.0"}
ethbridge-bridge-events.workspace = true
ethbridge-events.workspace = true
ethbridge-governance-events.workspace = true
eyre.workspace = true
fd-lock.workspace = true
ferveo-common.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion apps/src/bin/namada-relayer/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async fn main() -> Result<()> {
// init logging
logging::init_from_env_or(LevelFilter::INFO)?;

let (cmd, _) = cli::namada_relayer_cli()?;
let cmd = cli::namada_relayer_cli()?;
// run the CLI
CliApi::<()>::handle_relayer_command::<HttpClient>(None, cmd).await
}
Loading