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

Update eth-bridge-integration to v0.8.1 #704

Merged
merged 526 commits into from
Nov 2, 2022

Conversation

james-chf
Copy link
Contributor

@james-chf james-chf commented Oct 27, 2022

Closes #673

This PR merges v0.8.1 into eth-bridge-integration, and fixes things up.

This PR also merges #694 to fix a wasm test that was failing in eth-bridge-integration, so that CI can pass on this PR

Prebuilt .anoma that works with this PR:
local.32dd1d2fd99d3dcdb3c159cd.prebuilt.tar.gz

@james-chf james-chf force-pushed the interop/ethbridge/merge-0.8.1 branch from eab5cad to bd1cdd8 Compare October 28, 2022 13:06
…terop/ethbridge/merge-0.8.1

* james/mainline/dont-spawn-internal-account-vps:
  Remove comment
  Update spawn_accounts to ignore implicit addresses
  Add changelog
  TestTxEnv::spawn_accounts should ignore internal addresses
@james-chf
Copy link
Contributor Author

pls update wasm

@james-chf
Copy link
Contributor Author

pls update wasm

@james-chf james-chf force-pushed the interop/ethbridge/merge-0.8.1 branch from 4e26648 to 8ae9563 Compare October 31, 2022 17:45
@james-chf james-chf marked this pull request as ready for review October 31, 2022 18:09
# TODO temp patch for <https://github.com/near/borsh-rs/issues/82>, <https://github.com/near/borsh-rs/issues/84> and more tba.
borsh = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"}
borsh-derive = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"}
borsh-derive-internal = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"}
borsh-schema-derive-internal = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"}
# The following 3 crates patch a work-around for https://github.com/smol-rs/polling/issues/38 breaking namada tooling build with nightly 2022-05-20
polling = {git = "https://github.com/heliaxdev/polling.git", rev = "02a655775282879459a3460e2646b60c005bca2c"}
Copy link
Member

Choose a reason for hiding this comment

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

I'm so unhappy that this is how they decided to deal with this issue. If we had just frozen the minor version, we wouldn't need such a heavy handed workaround

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah it's a bit hacky

Copy link
Member

Choose a reason for hiding this comment

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

oh this can actually be dropped now since we removed the intent gossiper/matchmaker with libp2p that was pulling these in

ark-serialize = "0.3.0"
ark-std = "0.3.0"
# branch = "bat/arse-merkle-tree"
arse-merkle-tree = {package = "sparse-merkle-tree", git = "https://github.com/heliaxdev/sparse-merkle-tree", rev = "04ad1eeb28901b57a7599bbe433b3822965dabe8", features = ["std", "borsh"]}
Copy link
Member

Choose a reason for hiding this comment

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

alphabetization stronk

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah we should actually have this as a lint or something on our Cargo.tomls. Would reduce merge conflicts in the future

@@ -191,17 +191,36 @@ fn address_list(ctx: Context) {
}
}

/// Find address by its alias.
fn address_find(ctx: Context, args: args::AddressFind) {
/// Find address (alias) by its alias (address).
Copy link
Member

Choose a reason for hiding this comment

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

perplexing docstring

@@ -345,10 +333,31 @@ pub async fn join_network(
.await
.unwrap();
}
if !dont_prefetch_wasm {
Copy link
Member

Choose a reason for hiding this comment

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

Double negatives. Tsk tsk

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah we could have a style guide around this.

use namada::types::transaction::protocol::ProtocolTxType;

use super::queries::QueriesExt;
use super::governance::execute_governance_proposals;
Copy link
Member

Choose a reason for hiding this comment

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

super::* should come first

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This actually gets reordered by rustfmt if I try to put super::* first. We should update the rustfmt settings if we want to enforce this

Copy link
Collaborator

@sug0 sug0 Nov 2, 2022

Choose a reason for hiding this comment

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

generally, anything that does a star import should come first in the list of imports, IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, we could PR a suggestion to change rustfmt settings in main to do this

Copy link
Collaborator

@sug0 sug0 left a comment

Choose a reason for hiding this comment

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

left a few comments. generally, I think it's fine to merge this, but some things should be changed after the merge IMO

@@ -56,7 +55,7 @@ fn run_ledger() -> Result<()> {
let mut ledger =
run_as!(test, Who::NonValidator, Bin::Node, args, Some(40))?;
ledger.exp_string("Anoma ledger node started")?;
ledger.exp_string("This node is a fullnode")?;
ledger.exp_string("This node is not a validator")?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I preferred This node is a fullnode

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no preference though we should have some helper func or something to centralize this check, atm these lines are duplicated in a few places

Comment on lines +1265 to +1269
client.exp_string(
"Invalid proposal end epoch: difference between proposal start and \
end epoch must be at least 3 and at max 27 and end epoch must be a \
multiple of 3",
)?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

inb4 this test fails in the future because this specific log string changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah we shouldn't be testing by asserting on log strings imo. Right now this is the way it currently is though

Comment on lines +2050 to +2074
validator_0_copy.exp_string("Anoma ledger node started")?;
validator_0_copy.exp_string("This node is a validator")?;
let _bg_validator_0_copy = validator_0_copy.background();

// 5. Submit a valid token transfer tx to validator 0
let validator_one_rpc = get_actor_rpc(&test, &Who::Validator(0));
let tx_args = [
"transfer",
"--source",
BERTHA,
"--target",
ALBERT,
"--token",
XAN,
"--amount",
"10.1",
"--fee-amount",
"0",
"--gas-limit",
"0",
"--fee-token",
XAN,
"--ledger-address",
&validator_one_rpc,
];
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this code allows you to run into #644

Copy link
Collaborator

Choose a reason for hiding this comment

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

we should check if the rpc server has started, no?

Comment on lines +2075 to +2077
let mut client = run!(test, Bin::Client, tx_args, Some(40))?;
client.exp_string("Transaction is valid.")?;
client.assert_success();
Copy link
Collaborator

Choose a reason for hiding this comment

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

should be checking if the tx was applied. Transaction is valid gets logged for accepted and applied txs

Comment on lines +32 to +37
pub struct LazyMap<K, V, SON = super::Simple> {
key: storage::Key,
phantom_k: PhantomData<K>,
phantom_v: PhantomData<V>,
phantom_son: PhantomData<SON>,
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice. this will be useful for some refactors

}
Sub::SubscribeTopic(SubscribeTopic(args)) => {
gossip::subscribe_topic(ctx, args).await;
}
}
}
cli::AnomaClient::WithoutContext(cmd, global_args) => match cmd {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
cli::AnomaClient::WithoutContext(cmd, global_args) => match cmd {
cli::NamadaClient::WithoutContext(cmd, global_args) => match cmd {

eventually we should update these idents

use namada::types::transaction::Fee;
use tempfile::tempdir;
use tokio::sync::mpsc::{Sender, UnboundedReceiver};

use super::*;
#[cfg(feature = "abciplus")]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
#[cfg(feature = "abciplus")]
#[cfg(not(feature = "abcipp"))]

we should follow the general pattern of the shims. we don't use abciplus anywhere else I don't think

@@ -28,7 +30,7 @@ pub const ENV_VAR_TM_STDOUT: &str = "ANOMA_TM_STDOUT";

#[cfg(feature = "abciplus")]
pub const VERSION_REQUIREMENTS: &str = ">= 0.37.0-alpha.2, <0.38.0";
#[cfg(feature = "abcipp")]
#[cfg(not(feature = "abciplus"))]
Copy link
Collaborator

Choose a reason for hiding this comment

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

same thing here

@james-chf james-chf merged commit 1a9a48e into eth-bridge-integration Nov 2, 2022
@james-chf james-chf deleted the interop/ethbridge/merge-0.8.1 branch November 2, 2022 12:17
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.