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

Merge 0.9.0 into eth-bridge-integration #723

Merged
merged 90 commits into from
Nov 7, 2022

Conversation

juped
Copy link
Member

@juped juped commented Nov 1, 2022

wip, still needs rpc reimplemented

Gianmarco Fraccaroli and others added 30 commits October 18, 2022 12:22
This adds a new feature "async-client" and "tendermint-rpc" to shared
crate that if enabled generate async client code for all router's
handler methods, and implements it for tendermint-rpc client,
respectively.
…ker' (#678)

* fraccaman/ci-docs-cache:
  ci: invalide cf cache

* fraccaman/ci-linker:
  ci: use mold linker
…/merge-0.9.0

* tomas/storage-read-height-bug:
  changelog: add #706
  config: add `shell.storage_read_past_height_limit`, use it for queries
  storage: fix block heights used in read, write and delete
  rocksdb: fix delete_subspace_val diff write
  rocksdb: fix read_subspace_val_with_height
  test/storage: add a test for reading from arbitrary block heights

# Conflicts:
#	apps/src/lib/node/ledger/shell/mod.rs
…0.9.0

* eth-bridge-integration: (194 commits)
  [c hore]: rebasing
  Update shared/src/types/key/secp256k1.rs
  Update shared/src/types/vote_extensions/validator_set_update.rs
  [fix]: Adding changes from code review
  Update shared/src/types/eth_bridge_pool.rs
  [feat]: Added recovery ids to secp256k1 signatures
  [chore]: Added unit tests to the queries and fixed bugs it found
  [feat]: Added query end points to get the contents of the eth bridge pool and request merkle proofs
  [feat]: Added recovery ids to secp256k1 signatures
  [chore]: Added unit tests to the queries and fixed bugs it found
  [feat]: Added query end points to get the contents of the eth bridge pool and request merkle proofs
  [feat]: Added recovery ids to secp256k1 signatures
  [chore]: Added unit tests to the queries and fixed bugs it found
  [feat]: Added query end points to get the contents of the eth bridge pool and request merkle proofs
  [feat]: Added recovery ids to secp256k1 signatures
  [chore]: Added unit tests to the queries and fixed bugs it found
  [feat]: Added query end points to get the contents of the eth bridge pool and request merkle proofs
  [fix]: Removed duplicated code block
  [feat]: Added recovery ids to secp256k1 signatures
  [chore]: Added unit tests to the queries and fixed bugs it found
  [feat]: Added query end points to get the contents of the eth bridge pool and request merkle proofs
  [feat]: Added recovery ids to secp256k1 signatures
  [chore]: Added unit tests to the queries and fixed bugs it found
  [feat]: Added query end points to get the contents of the eth bridge pool and request merkle proofs
  [feat]: Added recovery ids to secp256k1 signatures
  [chore]: Added unit tests to the queries and fixed bugs it found
  [feat]: Added query end points to get the contents of the eth bridge pool and request merkle proofs
  [feat]: Added recovery ids to secp256k1 signatures
  [chore]: Added unit tests to the queries and fixed bugs it found
  [feat]: Added query end points to get the contents of the eth bridge pool and request merkle proofs
  [chore]: rebasing on eth-bridge-integration
  [chore]: Rebase on previous branches
  [feat]: Added recovery ids to secp256k1 signatures
  [chore]: Added unit tests to the queries and fixed bugs it found
  [feat]: Added query end points to get the contents of the eth bridge pool and request merkle proofs
  [feat]: Added recovery ids to secp256k1 signatures
  [chore]: Added unit tests to the queries and fixed bugs it found
  [feat]: Added query end points to get the contents of the eth bridge pool and request merkle proofs
  [feat]: Added recovery ids to secp256k1 signatures
  [chore]: Added unit tests to the queries and fixed bugs it found
  [feat]: Added query end points to get the contents of the eth bridge pool and request merkle proofs
  rebasing
  [feat]: Added recovery ids to secp256k1 signatures
  [chore]: Added unit tests to the queries and fixed bugs it found
  [feat]: Added query end points to get the contents of the eth bridge pool and request merkle proofs
  [fix]: Removed duplicated code block
  [feat]: Added recovery ids to secp256k1 signatures
  [chore]: Added unit tests to the queries and fixed bugs it found
  [feat]: Added query end points to get the contents of the eth bridge pool and request merkle proofs
  [feat]: Added recovery ids to secp256k1 signatures
  [chore]: Upgrading to v0.8
  [feat]: Added query end points to get the contents of the eth bridge pool and request merkle proofs
  [chore]: rebasing on changes from previous feature prs
  [feat]: Added recovery ids to secp256k1 signatures
  [chore]: Added unit tests to the queries and fixed bugs it found
  [feat]: Added query end points to get the contents of the eth bridge pool and request merkle proofs
  rebasing
  [feat]: Added val set args for relaying to ethereum
  [feat]: Corrected the abi encodings of bridge proofs
  [fix]: Fixed bug that produced proof for values not in the bridge pool and covered with test
  [feat]: Added recovery ids to secp256k1 signatures
  [chore]: Added unit tests to the queries and fixed bugs it found
  [feat]: Added query end points to get the contents of the eth bridge pool and request merkle proofs
  [feat]: Updated bridge pool vp with the the new merklized storage
  [chore]: Rebased onto PR #573
  [feat]: Changed the bridge pool vp to used the merklized storage
  [feat]: Updated bridge pool vp with the the new merklized storage
  [feat]: Changed the bridge pool vp to used the merklized storage
  [feat]: Updated bridge pool vp with the the new merklized storage
  [chore]: Rebasing on v0.8
  [fix]: Tiny from code review
  [fix]: Some more error logging and formatting
  Update shared/src/ledger/eth_bridge/vp/mod.rs
  [feat]: Added checks the bridge pool vp that erc20 tokens are escrowed to its account
  [feat]: Bridge pool vp now checks that funds to be transferred are escrowed. Needs tests
  [fix]: Tiny from code review
  [fix]: Some more error logging and formatting
  Update shared/src/ledger/eth_bridge/vp/mod.rs
  [feat]: Added a nomralized voting power type
  Update shared/src/types/key/secp256k1.rs
  Update shared/src/types/vote_extensions/validator_set_update.rs
  [fix]: Adding changes from code review
  Update shared/src/types/eth_bridge_pool.rs
  [feat]: Added checks the bridge pool vp that erc20 tokens are escrowed to its account
  Rename fvp to voting_power
  [chore]: Formatting
  [feat]: Bridge pool vp now checks that funds to be transferred are escrowed. Needs tests
  [chore]: Formatting
  [chore]: rebasing on eth-bridge-integration
  Remove TODO item
  [chore]: Rebase on previous branches
  [feat]: Added recovery ids to secp256k1 signatures
  [chore]: Added unit tests to the queries and fixed bugs it found
  [feat]: Added query end points to get the contents of the eth bridge pool and request merkle proofs
  [feat]: Added recovery ids to secp256k1 signatures
  [chore]: Added unit tests to the queries and fixed bugs it found
  [feat]: Added query end points to get the contents of the eth bridge pool and request merkle proofs
  [feat]: Added recovery ids to secp256k1 signatures
  [chore]: Added unit tests to the queries and fixed bugs it found
  [feat]: Added query end points to get the contents of the eth bridge pool and request merkle proofs
  ...

# Conflicts:
#	Cargo.lock
#	apps/src/lib/node/ledger/rpc.rs
#	apps/src/lib/node/ledger/shell/queries.rs
#	shared/src/ledger/eth_bridge/bridge_pool_vp.rs
#	shared/src/ledger/protocol/transactions/ethereum_events/eth_msgs.rs
#	shared/src/ledger/protocol/transactions/ethereum_events/mod.rs
#	shared/src/ledger/protocol/transactions/votes.rs
#	shared/src/ledger/storage/mod.rs
#	wasm/checksums.json
@james-chf
Copy link
Contributor

Current status: refactoring of bridge pool query endpoints to work with the new RPC router is WIP, some tests are still broken. There are still some conflicts with latest eth-bridge-integration that need to be merged in, after those tests are fixed up.

@james-chf
Copy link
Contributor

Compiling with abcipp is also broken, though this is also the case on main - have reappropiated #497 as an issue to fix this up in both the branches

@james-chf
Copy link
Contributor

pls update wasm

@james-chf james-chf force-pushed the james+ray/ethbridge/merge-0.9.0 branch from ed55261 to 25c3a3e Compare November 4, 2022 16:18
@james-chf james-chf marked this pull request as ready for review November 4, 2022 16:39
@@ -153,7 +162,7 @@ impl From<ProposalEvent> for Event {
}

/// Convert our custom event into the necessary tendermint proto type
impl From<Event> for crate::facade::tendermint_proto::abci::Event {
impl From<Event> for tendermint_proto::abci::Event {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be crate::facade::tendermint_proto::abci::Event, right?

Copy link
Contributor

@james-chf james-chf Nov 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no facade module in shared (currently), though there is something similar in shared/lib.rs

#[cfg(not(feature = "abcipp"))]
pub use {ibc, ibc_proto, tendermint, tendermint_proto};
#[cfg(feature = "abcipp")]
pub use {
ibc_abcipp as ibc, ibc_proto_abcipp as ibc_proto,
tendermint_abcipp as tendermint,
tendermint_proto_abcipp as tendermint_proto,
};

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh right, this isn't in apps... yeah, we can use crate::<dep> inside of shared/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, this should be using that, will update

// use `storage_has_key` instead of `storage_value`, because `storage_value`
// returns 0 bytes when the key is not found.
let maybe_unit = T::try_from_slice(&[]);
if let Ok(unit) = maybe_unit {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow. what a hack 😆

@batconjurer batconjurer mentioned this pull request Nov 7, 2022
@@ -103,13 +104,48 @@ pub fn keccak_hash(bytes: &[u8]) -> KeccakHash {

/// This module defines encoding methods compatible with Ethereum
/// smart contracts.
// TODO: relocate this sub-module to a new home
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been thinking about this for a while too. Maybe we should just have an ABI mod which has both encode and keccak submods

Copy link
Member

@batconjurer batconjurer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question really.

_marker: PhantomData<*const T>,
}

impl<T> EncodeCell<T> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting. Should we change the return type of the Encode::encode method to return an instance of this struct? @sug0 ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, we could do that, and introduce an encode_raw() that simply "unwraps" the cell

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it.

@@ -148,6 +149,63 @@ pub fn get_epoch(test: &Test, ledger_address: &str) -> Result<Epoch> {
Ok(Epoch(epoch))
}

/// Get the last committed block height.
pub fn get_height(test: &Test, ledger_address: &str) -> Result<u64> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

☹️

@james-chf james-chf merged commit f5a7a36 into eth-bridge-integration Nov 7, 2022
@james-chf james-chf deleted the james+ray/ethbridge/merge-0.9.0 branch November 7, 2022 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.