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

Add more logging around vote extensions #764

Merged
merged 10 commits into from
Nov 15, 2022
14 changes: 6 additions & 8 deletions apps/src/lib/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1380,13 +1380,11 @@ pub mod args {
const FEE_AMOUNT: ArgDefault<token::Amount> =
arg_default("fee-amount", DefaultFn(|| token::Amount::from(0)));
const FEE_PAYER: Arg<WalletAddress> = arg("fee-payer");
const FEE_TOKEN: ArgDefaultFromCtx<WalletAddress> =
arg_default_from_ctx("fee-token", DefaultFn(|| "NAM".into()));
const FORCE: ArgFlag = flag("force");
const GAS_AMOUNT: ArgDefault<token::Amount> =
arg_default("gas-amount", DefaultFn(|| token::Amount::from(0)));
const GAS_LIMIT: ArgDefault<token::Amount> =
arg_default("gas-limit", DefaultFn(|| token::Amount::from(0)));
const GAS_TOKEN: ArgDefaultFromCtx<WalletAddress> =
arg_default_from_ctx("gas-token", DefaultFn(|| "NAM".into()));
const GENESIS_PATH: Arg<PathBuf> = arg("genesis-path");
const GENESIS_VALIDATOR: ArgOpt<String> = arg("genesis-validator").opt();
const HASH_LIST: Arg<String> = arg("hash-list");
Expand Down Expand Up @@ -2413,10 +2411,10 @@ pub mod args {
initialized, the alias will be the prefix of each new \
address joined with a number.",
))
.arg(GAS_AMOUNT.def().about(
.arg(FEE_AMOUNT.def().about(
"The amount being paid for the inclusion of this transaction",
))
.arg(GAS_TOKEN.def().about("The token for paying the fee"))
.arg(FEE_TOKEN.def().about("The token for paying the fee"))
.arg(
GAS_LIMIT.def().about(
"The maximum amount of gas needed to run transaction",
Expand Down Expand Up @@ -2449,8 +2447,8 @@ pub mod args {
let broadcast_only = BROADCAST_ONLY.parse(matches);
let ledger_address = LEDGER_ADDRESS_DEFAULT.parse(matches);
let initialized_account_alias = ALIAS_OPT.parse(matches);
let fee_amount = GAS_AMOUNT.parse(matches);
let fee_token = GAS_TOKEN.parse(matches);
let fee_amount = FEE_AMOUNT.parse(matches);
james-chf marked this conversation as resolved.
Show resolved Hide resolved
let fee_token = FEE_TOKEN.parse(matches);
let gas_limit = GAS_LIMIT.parse(matches).into();

let signing_key = SIGNING_KEY_OPT.parse(matches);
Expand Down
15 changes: 13 additions & 2 deletions apps/src/lib/node/ledger/shell/vote_extensions/eth_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ where
.map_err(|err| {
tracing::error!(
?err,
?ext.sig,
?pk,
%validator,
"Failed to verify the signature of an Ethereum events vote \
extension issued by some validator"
Expand Down Expand Up @@ -261,13 +263,22 @@ where
);
}

let key = (addr, block_height);
tracing::debug!(
?key,
?sig,
?validator_addr,
"Inserting signature into ethereum_events::VextDigest"
);
#[cfg(not(feature = "abcipp"))]
if let Some(sig) = signatures.insert((addr, block_height), sig) {
if let Some(existing_sig) = signatures.insert(key, sig.clone()) {
tracing::warn!(
?sig,
?existing_sig,
?validator_addr,
"Overwrote old signature from validator while \
constructing ethereum_events::VextDigest"
constructing ethereum_events::VextDigest - maybe private \
key of validator is being used by multiple nodes?"
);
}
}
Expand Down
16 changes: 13 additions & 3 deletions apps/src/lib/node/ledger/shell/vote_extensions/val_set_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ where
.map_err(|err| {
tracing::error!(
?err,
?ext.sig,
?pk,
%validator,
"Failed to verify the signature of a valset upd vote \
extension issued by some validator"
Expand Down Expand Up @@ -263,14 +265,22 @@ where
constructing validator_set_update::VextDigest"
);
}

let key = (addr, block_height);
tracing::debug!(
?key,
?sig,
?validator_addr,
"Inserting signature into validator_set_update::VextDigest"
);
#[cfg(not(feature = "abcipp"))]
if let Some(sig) = signatures.insert((addr, block_height), sig) {
if let Some(existing_sig) = signatures.insert(key, sig.clone()) {
tracing::warn!(
?sig,
?existing_sig,
?validator_addr,
"Overwrote old signature from validator while \
constructing validator_set_update::VextDigest"
constructing validator_set_update::VextDigest - maybe \
private key of validator is being used by multiple nodes?"
);
}
}
Expand Down
26 changes: 13 additions & 13 deletions wasm/checksums.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"tx_bond.wasm": "tx_bond.4385ddcf475bf5d03cfaa2cc6816a0741b3fd894a592354aae87b19135874e62.wasm",
"tx_bond.wasm": "tx_bond.a2d03adca103b0acc5997b926990ff4de4650268203e9d3350e004eab074634a.wasm",
"tx_bridge_pool.wasm": "tx_bridge_pool.e21563260c03cfdab1f195878f49bf93722027ad26fcd097cfebbc5c4d279082.wasm",
"tx_ibc.wasm": "tx_ibc.36d265ef84f11e82c304b965d9852c3aac72bd50061212e8be1d03b632579c1e.wasm",
"tx_init_account.wasm": "tx_init_account.9c0701134b0f1b3b17ff21560b8ee16a761aba2c371a5ab3c4763c7f1c3d8f42.wasm",
"tx_init_proposal.wasm": "tx_init_proposal.0246bc54874b4ecf664dbd9441c747b257996c14b229b8c5e74c2f62784a3243.wasm",
"tx_init_validator.wasm": "tx_init_validator.4ea7273d501c6be0f57ff411645fbb02bb35a8be84ec2f3305baf0b5a2d868d4.wasm",
"tx_transfer.wasm": "tx_transfer.ad40979d4a1518c9c7463648cc63212991a149f898e53423569d7eea82f73d09.wasm",
"tx_unbond.wasm": "tx_unbond.cc1425fbb1fc5f9c3db8940f3c8713d79d9224b936f2763acd5f77a129dbfdce.wasm",
"tx_update_vp.wasm": "tx_update_vp.74fbce3cf33900a5b5c6291db82b53bfe5ca2f0d5b6b87bc83667206746e0ca5.wasm",
"tx_vote_proposal.wasm": "tx_vote_proposal.c2708194bb19f1b3a2f629dc22a9e11788d35e8a570b9eb77d32f27994280a36.wasm",
"tx_withdraw.wasm": "tx_withdraw.77ab8eb211d24b8713458adc248724c571371e7dfedf22a30f6a13c0c9110ed3.wasm",
"vp_testnet_faucet.wasm": "vp_testnet_faucet.66aa929d4f17249d9b1b4d3e0053a21f4bc46c0326c082f84e2e02161f00a392.wasm",
"vp_token.wasm": "vp_token.6ac1cf76dd3d8cfef8f2fd1400e2b2488c7553855f3fb009bb7199c085b1d249.wasm",
"vp_user.wasm": "vp_user.74ed31241805844c86e1185746b084ee326b53e6e773b4cdf7a5a925fa804280.wasm"
"tx_ibc.wasm": "tx_ibc.2b467845c55820345ce48e2da4f7c2606566555eac12ee64f8baeb5b63dfae83.wasm",
"tx_init_account.wasm": "tx_init_account.86e02762f60428966c7ab4f780fc4dbcc794ae0aa791930f27e246c2c289e045.wasm",
"tx_init_proposal.wasm": "tx_init_proposal.f654f0e4610e03c9ffcc36225f67822200aa89f3633f16a9eb0b47813f8ec15a.wasm",
"tx_init_validator.wasm": "tx_init_validator.b4e6713e69aa341339a836de6901c7c29a532849577514255ecb3092882a12c3.wasm",
"tx_transfer.wasm": "tx_transfer.e3c687a17173af07b4be0fc0af06ebe6dbba1d5195b8e3015c955eeaaa53e59e.wasm",
"tx_unbond.wasm": "tx_unbond.4480c046edf32bf97d2d40d45b2bd05547049cae22df48f3fc433f151b495e2b.wasm",
"tx_update_vp.wasm": "tx_update_vp.b057de2c9f17a634aaf011f6bf6bb0bac198ae522c5a24a44dec71d9b649c7e7.wasm",
"tx_vote_proposal.wasm": "tx_vote_proposal.4625c309121620a10b9b87b4f4622b8a899f758c08d5ae0341a6f80ce932e089.wasm",
"tx_withdraw.wasm": "tx_withdraw.6ee49918852f375271a444c111b73ddcf20e237af852579b4fcc4caab17a2715.wasm",
"vp_testnet_faucet.wasm": "vp_testnet_faucet.e417000da4f7640a5fb5f124755ed02b8654aa67db600bea6e93e1f04e6d71a3.wasm",
"vp_token.wasm": "vp_token.37749e16d9fcd17dc2cf3351b0a140b5821668f80d6cc805caeb3e8e9af06cd9.wasm",
"vp_user.wasm": "vp_user.8c117faa94e44833fb7a16d13067f7626ecfca6a70fec1b7822c7d9a6c3e909e.wasm"
}