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

Print local testnet logs as println and errors as eprintln #15005

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

0xmaayan
Copy link
Contributor

Description

The local testnet currently prints regular logs using eprintln, which is intended for error messages. Update the logs to use println for regular output and reserve eprintln for errors (such as Docker setup issues).

How Has This Been Tested?

Key Areas to Review

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
  • Move Compiler
  • Other (specify)

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 Oct 18, 2024

⏱️ 1h 26m total CI duration on this PR
Slowest 15 Jobs Cumulative Duration Recent Runs
forge-framework-upgrade-test / forge 21m 🟥🟥
test-target-determinator 9m 🟩🟩
execution-performance / test-target-determinator 9m 🟩🟩
check 8m 🟩🟩
rust-cargo-deny 7m 🟩🟩🟩🟩
check-dynamic-deps 6m 🟩🟩🟩🟩
rust-doc-tests 5m 🟩
rust-doc-tests 5m 🟩
fetch-last-released-docker-image-tag 3m 🟩🟩
semgrep/ci 2m 🟩🟩🟩🟩
general-lints 2m 🟩🟩🟩🟩
rust-move-tests 2m 🟩
rust-move-tests 2m 🟩
rust-move-tests 1m 🟩
rust-move-tests 1m 🟩

🚨 1 job on the last run was significantly faster/slower than expected

Job Duration vs 7d avg Delta
execution-performance / single-node-performance 10s 18m -99%

settingsfeedbackdocs ⋅ learn more about trunk.io

@@ -30,7 +30,8 @@ pub const CONTAINER_NETWORK_NAME: &str = "aptos-local-testnet-network";
/// there no second location, there is just the one named pipe.
pub async fn get_docker() -> Result<Docker> {
let docker = Docker::connect_with_local_defaults()
.context(format!("{} (init_default)", ERROR_MESSAGE))?;
.context(format!("{} (init_default)", ERROR_MESSAGE))
.inspect_err(|e| eprintln!("{:#}", e))?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Just confirming, you're happy for this to be spread across multiple lines? If not, you can just use {} instead of {:#}.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks like it is one line?

Unexpected error: Failed to apply pre run steps for Postgres: Docker is not available, confirm it is installed and running. See https://aptos.dev/guides/local-development-network#faq for assistance. (version_home): error trying to connect: No such file or directory (os error 2): No such file or directory (os error 2)
image

@gregnazario
Copy link
Contributor

Note: Probably add it to the changelog

@0xmaayan 0xmaayan force-pushed the maayan/log_errors_as_eprintln branch from b65c2c9 to f6988a0 Compare October 18, 2024 16:43
@0xmaayan
Copy link
Contributor Author

Update the logs to use println for regular output and reserve eprintln for errors

thanks. done

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.

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.

This comment has been minimized.

Copy link
Contributor

✅ Forge suite compat success on b29f09f57e898d8d211c8bc3e303f6e50bba2266 ==> addb198db275cffda72cc7c88df41571f1bbaabc

Compatibility test results for b29f09f57e898d8d211c8bc3e303f6e50bba2266 ==> addb198db275cffda72cc7c88df41571f1bbaabc (PR)
1. Check liveness of validators at old version: b29f09f57e898d8d211c8bc3e303f6e50bba2266
compatibility::simple-validator-upgrade::liveness-check : committed: 13205.46 txn/s, latency: 2581.66 ms, (p50: 2200 ms, p70: 2400, p90: 3500 ms, p99: 8100 ms), latency samples: 427860
2. Upgrading first Validator to new version: addb198db275cffda72cc7c88df41571f1bbaabc
compatibility::simple-validator-upgrade::single-validator-upgrading : committed: 7311.17 txn/s, latency: 3884.83 ms, (p50: 4400 ms, p70: 4700, p90: 4800 ms, p99: 4900 ms), latency samples: 133760
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 6758.94 txn/s, latency: 4349.04 ms, (p50: 4700 ms, p70: 4800, p90: 5000 ms, p99: 5300 ms), latency samples: 253160
3. Upgrading rest of first batch to new version: addb198db275cffda72cc7c88df41571f1bbaabc
compatibility::simple-validator-upgrade::half-validator-upgrading : committed: 7354.45 txn/s, latency: 3878.87 ms, (p50: 4300 ms, p70: 4600, p90: 4800 ms, p99: 4800 ms), latency samples: 138100
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 6590.61 txn/s, latency: 4904.93 ms, (p50: 4800 ms, p70: 5100, p90: 7000 ms, p99: 7300 ms), latency samples: 229520
4. upgrading second batch to new version: addb198db275cffda72cc7c88df41571f1bbaabc
compatibility::simple-validator-upgrade::rest-validator-upgrading : committed: 9455.47 txn/s, latency: 2856.48 ms, (p50: 2900 ms, p70: 3000, p90: 4400 ms, p99: 4800 ms), latency samples: 188220
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 10048.83 txn/s, latency: 3089.82 ms, (p50: 2800 ms, p70: 2900, p90: 5800 ms, p99: 7400 ms), latency samples: 325800
5. check swarm health
Compatibility test for b29f09f57e898d8d211c8bc3e303f6e50bba2266 ==> addb198db275cffda72cc7c88df41571f1bbaabc passed
Test Ok

Copy link
Contributor

✅ Forge suite realistic_env_max_load success on addb198db275cffda72cc7c88df41571f1bbaabc

two traffics test: inner traffic : committed: 14037.43 txn/s, submitted: 14038.11 txn/s, expired: 0.68 txn/s, latency: 2825.99 ms, (p50: 2700 ms, p70: 2700, p90: 3000 ms, p99: 3300 ms), latency samples: 5337340
two traffics test : committed: 100.11 txn/s, latency: 1634.15 ms, (p50: 1500 ms, p70: 1600, p90: 1700 ms, p99: 11200 ms), latency samples: 1780
Latency breakdown for phase 0: ["QsBatchToPos: max: 0.246, avg: 0.226", "QsPosToProposal: max: 1.170, avg: 1.121", "ConsensusProposalToOrdered: max: 0.317, avg: 0.298", "ConsensusOrderedToCommit: max: 0.492, avg: 0.469", "ConsensusProposalToCommit: max: 0.790, avg: 0.767"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 1.06s no progress at version 2384061 (avg 0.21s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 8.54s no progress at version 2384059 (avg 8.54s) [limit 15].
Test Ok

Copy link
Contributor

✅ Forge suite framework_upgrade success on b29f09f57e898d8d211c8bc3e303f6e50bba2266 ==> addb198db275cffda72cc7c88df41571f1bbaabc

Compatibility test results for b29f09f57e898d8d211c8bc3e303f6e50bba2266 ==> addb198db275cffda72cc7c88df41571f1bbaabc (PR)
Upgrade the nodes to version: addb198db275cffda72cc7c88df41571f1bbaabc
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1183.22 txn/s, submitted: 1184.34 txn/s, failed submission: 1.12 txn/s, expired: 1.12 txn/s, latency: 2518.71 ms, (p50: 2100 ms, p70: 2400, p90: 5100 ms, p99: 7200 ms), latency samples: 105580
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1148.27 txn/s, submitted: 1149.68 txn/s, failed submission: 1.41 txn/s, expired: 1.41 txn/s, latency: 2781.19 ms, (p50: 2400 ms, p70: 3000, p90: 4800 ms, p99: 6900 ms), latency samples: 97700
5. check swarm health
Compatibility test for b29f09f57e898d8d211c8bc3e303f6e50bba2266 ==> addb198db275cffda72cc7c88df41571f1bbaabc passed
Upgrade the remaining nodes to version: addb198db275cffda72cc7c88df41571f1bbaabc
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1049.47 txn/s, submitted: 1051.02 txn/s, failed submission: 1.55 txn/s, expired: 1.55 txn/s, latency: 2864.95 ms, (p50: 2400 ms, p70: 3200, p90: 4800 ms, p99: 6700 ms), latency samples: 94920
Test Ok

@0xmaayan 0xmaayan merged commit 20ba96d into main Oct 18, 2024
48 checks passed
@0xmaayan 0xmaayan deleted the maayan/log_errors_as_eprintln branch October 18, 2024 18:27
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.

3 participants