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

[txn-emitter][simple] Reduce flakiness in txn emitter #14299

Merged
merged 4 commits into from
Oct 10, 2024

Conversation

igor-aptos
Copy link
Contributor

Description

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Other (specify)

How Has This Been Tested?

Key Areas to Review

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

Copy link

trunk-io bot commented Aug 16, 2024

⏱️ 21m total CI duration on this PR
Job Cumulative Duration Recent Runs
rust-cargo-deny 5m 🟩🟩🟩
general-lints 5m 🟩🟩🟩
check-dynamic-deps 3m 🟩🟩🟩
rust-move-tests 2m 🟩
rust-move-tests 1m 🟩
rust-move-tests 1m 🟩
semgrep/ci 1m 🟩🟩🟩
file_change_determinator 34s 🟩🟩🟩
file_change_determinator 30s 🟩🟩🟩
permission-check 12s 🟩🟩🟩
permission-check 9s 🟩🟩🟩
permission-check 8s 🟩🟩🟩
permission-check 8s 🟩🟩🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

Comment on lines 238 to 260
pub async fn view_account_balance(
&self,
address: AccountAddress,
coin_type: &str,
) -> AptosResult<Response<u64>> {
let resp = self
.view(&ViewRequest {
function: "0x1::coin::balance".parse()?,
type_arguments: vec![coin_type.parse()?],
arguments: vec![serde_json::Value::String(address.to_hex_literal())],
}, None)
.await?;

resp.and_then(|result| {
if result.len() != 1 {
Err(anyhow!("Wrong data size returned: {:?}", result).into())
} else {
result[0].as_str()
.ok_or_else(|| anyhow!("Wrong data type returned: {:?}", result).into())
.and_then(|v| v.parse::<u64>().map_err(|_e| anyhow!("Couldn't parse returned value: {:?}", result).into()))
}
})
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I would replace the existing balance call, with the BCS version since it's all abstracted away. Don't need two of these as view function functions, on top of the existing function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

view might be more expensive, so wanted it to be explicit.

but I can just rename from get_account_balance to view_account_balance and have all callers updated.

@igor-aptos igor-aptos force-pushed the igor/txn_emitter_fixes branch from 5bc7bb5 to 3f36d79 Compare August 30, 2024 19:40
@igor-aptos igor-aptos requested a review from gregnazario August 30, 2024 19:59
@igor-aptos
Copy link
Contributor Author

@gregnazario updated , does it look good now?

I couldn't run your test, as I don't have your account configuration locally

Copy link
Contributor

@msmouse msmouse left a comment

Choose a reason for hiding this comment

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

#seems-legit

would be nice if PR is with a proper summary.

Comment on lines +56 to +84
.collect::<Vec<_>>()
.await
.into_iter()
.collect::<Result<Vec<_>, _>>()?;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: use try_collect()?

@igor-aptos igor-aptos force-pushed the igor/txn_emitter_fixes branch from 3f36d79 to 2607526 Compare October 8, 2024 19:24
@igor-aptos igor-aptos enabled auto-merge (squash) October 10, 2024 05:32

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@igor-aptos igor-aptos force-pushed the igor/txn_emitter_fixes branch from 2607526 to 8c92e95 Compare October 10, 2024 06:54

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@igor-aptos igor-aptos force-pushed the igor/txn_emitter_fixes branch from 8c92e95 to c5a9a7e Compare October 10, 2024 15:46

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

✅ Forge suite realistic_env_max_load success on c5a9a7ed14da1530642bc94e54d40f04ae17f630

two traffics test: inner traffic : committed: 13367.45 txn/s, latency: 2975.40 ms, (p50: 2700 ms, p70: 3000, p90: 3000 ms, p99: 12100 ms), latency samples: 5082640
two traffics test : committed: 99.96 txn/s, latency: 2724.55 ms, (p50: 2500 ms, p70: 2700, p90: 2900 ms, p99: 10100 ms), latency samples: 1740
Latency breakdown for phase 0: ["QsBatchToPos: max: 0.261, avg: 0.221", "QsPosToProposal: max: 0.294, avg: 0.258", "ConsensusProposalToOrdered: max: 0.328, avg: 0.298", "ConsensusOrderedToCommit: max: 0.488, avg: 0.458", "ConsensusProposalToCommit: max: 0.787, avg: 0.757"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.97s no progress at version 1057670 (avg 0.21s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 8.23s no progress at version 1057668 (avg 8.20s) [limit 15].
Test Ok

Copy link
Contributor

✅ Forge suite compat success on 46bf19eb4f132b9d8fc19eff3f3334cdf9aa1775 ==> c5a9a7ed14da1530642bc94e54d40f04ae17f630

Compatibility test results for 46bf19eb4f132b9d8fc19eff3f3334cdf9aa1775 ==> c5a9a7ed14da1530642bc94e54d40f04ae17f630 (PR)
1. Check liveness of validators at old version: 46bf19eb4f132b9d8fc19eff3f3334cdf9aa1775
compatibility::simple-validator-upgrade::liveness-check : committed: 14289.67 txn/s, latency: 2269.61 ms, (p50: 1900 ms, p70: 2100, p90: 2800 ms, p99: 17200 ms), latency samples: 488780
2. Upgrading first Validator to new version: c5a9a7ed14da1530642bc94e54d40f04ae17f630
compatibility::simple-validator-upgrade::single-validator-upgrading : committed: 7472.02 txn/s, latency: 3793.56 ms, (p50: 4300 ms, p70: 4500, p90: 4600 ms, p99: 4700 ms), latency samples: 138980
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 6335.75 txn/s, latency: 4824.36 ms, (p50: 5000 ms, p70: 5200, p90: 5300 ms, p99: 6600 ms), latency samples: 239480
3. Upgrading rest of first batch to new version: c5a9a7ed14da1530642bc94e54d40f04ae17f630
compatibility::simple-validator-upgrade::half-validator-upgrading : committed: 6570.46 txn/s, latency: 4291.90 ms, (p50: 4600 ms, p70: 5100, p90: 5700 ms, p99: 6000 ms), latency samples: 127260
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 6778.81 txn/s, latency: 4744.42 ms, (p50: 5000 ms, p70: 5400, p90: 6500 ms, p99: 7000 ms), latency samples: 231040
4. upgrading second batch to new version: c5a9a7ed14da1530642bc94e54d40f04ae17f630
compatibility::simple-validator-upgrade::rest-validator-upgrading : committed: 11067.80 txn/s, latency: 2444.72 ms, (p50: 2300 ms, p70: 2600, p90: 3900 ms, p99: 4100 ms), latency samples: 192560
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 10244.18 txn/s, latency: 3007.48 ms, (p50: 2700 ms, p70: 2900, p90: 5700 ms, p99: 7100 ms), latency samples: 335880
5. check swarm health
Compatibility test for 46bf19eb4f132b9d8fc19eff3f3334cdf9aa1775 ==> c5a9a7ed14da1530642bc94e54d40f04ae17f630 passed
Test Ok

Copy link
Contributor

✅ Forge suite framework_upgrade success on 46bf19eb4f132b9d8fc19eff3f3334cdf9aa1775 ==> c5a9a7ed14da1530642bc94e54d40f04ae17f630

Compatibility test results for 46bf19eb4f132b9d8fc19eff3f3334cdf9aa1775 ==> c5a9a7ed14da1530642bc94e54d40f04ae17f630 (PR)
Upgrade the nodes to version: c5a9a7ed14da1530642bc94e54d40f04ae17f630
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1056.67 txn/s, submitted: 1058.44 txn/s, failed submission: 1.77 txn/s, expired: 1.77 txn/s, latency: 2782.83 ms, (p50: 2400 ms, p70: 3000, p90: 4600 ms, p99: 6600 ms), latency samples: 95600
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1189.62 txn/s, submitted: 1192.08 txn/s, failed submission: 2.46 txn/s, expired: 2.46 txn/s, latency: 2493.69 ms, (p50: 2400 ms, p70: 2700, p90: 3900 ms, p99: 5600 ms), latency samples: 106240
5. check swarm health
Compatibility test for 46bf19eb4f132b9d8fc19eff3f3334cdf9aa1775 ==> c5a9a7ed14da1530642bc94e54d40f04ae17f630 passed
Upgrade the remaining nodes to version: c5a9a7ed14da1530642bc94e54d40f04ae17f630
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1159.71 txn/s, submitted: 1161.51 txn/s, failed submission: 1.80 txn/s, expired: 1.80 txn/s, latency: 2683.41 ms, (p50: 2400 ms, p70: 3000, p90: 4200 ms, p99: 6400 ms), latency samples: 103060
Test Ok

@igor-aptos igor-aptos merged commit f28fc55 into main Oct 10, 2024
46 of 49 checks passed
@igor-aptos igor-aptos deleted the igor/txn_emitter_fixes branch October 10, 2024 18:59
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.

4 participants