Skip to content

Conversation

sebtomba
Copy link

@sebtomba sebtomba commented Aug 8, 2025

Description

  1. Enhance the validation tool by adding a feature to fetch transactions (up to the chain tip) from a validator node's REST API and store them in a (bcs) file. Note that the tool only saves user-signed transactions.
  2. Create a transaction comparison tool that reads stored transactions from the file, requests the corresponding transactions from a remote node, and compares them.

Also, refactor the api command to a subcommand so that every tool can be run independently.

How Has This Been Tested?

  1. Run a local validator node on real-world data (e.g. synced from mainnet). Use the waypoint.txt file for the ledger version.
  2. Run the tool with the waypoint ledger version - 1000 (or some other number).
./target/debug/validation-tool api transactions --url http://0.0.0.0:8080 --start 19332568 --out ~/tmp/transactions.bin
  1. Compare the saved transactions with transactions on a remote validator node.
./target/debug/validation-tool api compare-transactions --url http://0.0.0.0:8080  --in ~/tmp/transactions.bin

Caution

I haven't tested the transaction comparison against one of our mainnet nodes yet.
However, such a test could face issues with Cloudflare's rate limiting.

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

@sebtomba sebtomba requested review from areshand and 0xmovses August 8, 2025 14:42
@sebtomba sebtomba marked this pull request as ready for review August 11, 2025 11:57
@sebtomba sebtomba requested a review from musitdev August 11, 2025 11:57
Comment on lines +74 to +75
let str = format!("{}\n", hex::encode(&bytes));
writer.write_all(str.as_bytes()).await?;

Choose a reason for hiding this comment

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

As you use lines to read the file, perhaps you should use writeln! macro to avoid managing the \n ?

Copy link
Author

Choose a reason for hiding this comment

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

I'm using tokio for the async interface, and unfortunately, no writeln! macro is available.

@0xmovses
Copy link
Collaborator

What's the status of this PR, there are some conflicts before it can merge.

@sebtomba
Copy link
Author

As discussed today, we need to check which parts of this PR are still required. We now want a tool that reads new transactions from the da-sequencer and replays them on the validator node.

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