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

[ignore] experiment and investigation #15617

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

[ignore] experiment and investigation #15617

wants to merge 1 commit into from

Conversation

areshand
Copy link
Contributor

Description

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 Dec 16, 2024

⏱️ 37m total CI duration on this PR
Job Cumulative Duration Recent Runs
rust-move-tests 13m 🟩
rust-move-tests 13m 🟩
rust-cargo-deny 4m 🟩🟩
check-dynamic-deps 3m 🟩🟩🟩
semgrep/ci 1m 🟩🟩🟩
general-lints 1m 🟩🟩🟩
file_change_determinator 37s 🟩🟩🟩
rust-move-tests 35s
permission-check 9s 🟩🟩🟩
permission-check 8s 🟩🟩🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

Comment on lines +79 to +89
fn commit_batch(&self, batch: SchemaBatch) -> Result<()> {
Ok(())
}
Copy link

Choose a reason for hiding this comment

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

The commit_batch() method currently returns success without performing any operations, which will silently discard batches instead of persisting them. This empty implementation needs to be replaced with logic that actually commits the SchemaBatch to storage to prevent data loss. Consider adding error handling and verification of the commit as well.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

Comment on lines +93 to +105
let commit_thread = thread::spawn(move || {
while let Ok(batch) = self.batch_receiver.recv() {
self.commit_batch(batch).unwrap();
}
});
Copy link

Choose a reason for hiding this comment

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

The spawned commit_thread needs to be joined to ensure all commits are processed before the thread terminates. Consider storing the JoinHandle and joining it at the end of run() or in Drop implementation. This prevents potential data loss from premature thread termination.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

@@ -93,8 +125,7 @@ where
let version = output.expect_last_version();
let commit_start = Instant::now();
let ledger_info_with_sigs = gen_li_with_sigs(block_id, root_hash, version);
self.executor.pre_commit_block(block_id).unwrap();
self.executor.commit_ledger(ledger_info_with_sigs).unwrap();
self.prepare_commit(block_id, ledger_info_sigs).unwrap();
Copy link

Choose a reason for hiding this comment

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

The variable ledger_info_with_sigs is assigned on line 94, but is passed as ledger_info_sigs to prepare_commit(). Please update the argument name to match the original variable.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

@@ -124,7 +126,7 @@ where
.ledger_update(block_id, parent_block_id)
}

fn pre_commit_block(&self, block_id: HashValue) -> ExecutorResult<()> {
fn pre_commit_block(&self, block_id: HashValue, sender:) -> ExecutorResult<()> {
Copy link

Choose a reason for hiding this comment

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

There appears to be a syntax error in the function signature - the parameter sender: has a type annotation missing and ends with an erroneous colon. This will prevent compilation.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

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.

1 participant