Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
9fff6e6
Verify commit,prove,execute transaction is BatchStatusUpdater
cytadela8 May 25, 2025
97a3109
Rebase adjust
cytadela8 May 27, 2025
e3e6b59
testing WIP
cytadela8 May 27, 2025
a815c3f
wip Fix test
cytadela8 May 28, 2025
453dc5a
Fix tests!
cytadela8 May 28, 2025
562eee9
Cleanup
cytadela8 May 28, 2025
7d3b805
bugfix
cytadela8 May 28, 2025
b1bb2fa
lint
cytadela8 May 28, 2025
07997ab
Merge remote-tracking branch 'origin/main' into apu-fast-finality-l2
cytadela8 May 28, 2025
321d7fe
merge fix
cytadela8 May 28, 2025
d77a636
fmt
cytadela8 May 28, 2025
5fd67a6
Move checks to avoid unnecessery verification of l1 transactions
cytadela8 May 29, 2025
b8f90dc
Rework error handling
cytadela8 May 29, 2025
620dbe4
remove debug
cytadela8 May 29, 2025
fe4dd13
Improve valid transaction handling logic
cytadela8 May 29, 2025
1ab32cb
settlement_layer_client into eth_interface
cytadela8 May 29, 2025
81fffb7
Separate L1TransactionVerifier to module
cytadela8 May 29, 2025
89f3308
Merge remote-tracking branch 'origin/main' into apu-fast-finality-l2
cytadela8 May 29, 2025
4073397
Remove unneeded `pub`
cytadela8 May 29, 2025
8b4baa5
merge fixes
cytadela8 May 29, 2025
5fa6a10
rename
cytadela8 May 29, 2025
17df59e
Add invalid transaction test
cytadela8 Jun 2, 2025
0b3c02e
Ignore prove tx check on protocol version <v29
cytadela8 Jun 2, 2025
3478900
feat: do not verify batch transactions before v29
cytadela8 Jun 3, 2025
4cd2ae7
Add missing cfg feature gate
cytadela8 Jun 3, 2025
245f715
fix: better feature gate fix
cytadela8 Jun 3, 2025
4207902
Avoid expensive db query in prove tx verification
cytadela8 Jun 3, 2025
aaf32d9
reduce db calls in l1_transaction_verifier
cytadela8 Jun 4, 2025
e7911b2
mark as pending when inserting in batch_status_updater
cytadela8 Jun 7, 2025
cb425d9
Batch Transaction Updater
cytadela8 Jun 8, 2025
f2e520f
fixes, test compile
cytadela8 Jun 8, 2025
b92bef8
allow insert_bogus_confirmed_eth_tx outside tests
cytadela8 Jun 8, 2025
c00384f
logs
cytadela8 Jun 9, 2025
9fc244b
review feedback
cytadela8 Jun 9, 2025
5b6d174
Avoid expect
cytadela8 Jun 9, 2025
9baa4f9
Cleaner log
cytadela8 Jun 9, 2025
31e5fd6
Simplified batch trnsaction update logic
cytadela8 Jun 9, 2025
d46a36f
more logs
cytadela8 Jun 9, 2025
0a28324
Join L1BlockNumbers logic between eth_sender and batch_transaction_up…
cytadela8 Jun 10, 2025
6639041
Fix batch_status_updater tests
cytadela8 Jun 11, 2025
5941371
Tests
cytadela8 Jun 13, 2025
0d9d5e5
small refactor
cytadela8 Jun 13, 2025
1a163e6
Lint
cytadela8 Jun 13, 2025
72aea3f
fixes, test multistage
cytadela8 Jun 14, 2025
42fd5c4
Invalid tx test
cytadela8 Jun 15, 2025
29029b6
Logs
cytadela8 Jun 15, 2025
409a9c2
Remove unnecessery connection
cytadela8 Jun 15, 2025
a69d54d
Error in get_l1_batch_metadata_only in case of conversion error
cytadela8 Jun 15, 2025
5cbb7d4
More debugs ?REVERT_ME?
cytadela8 Jun 15, 2025
1f7567c
Initialize tree_data_fetcher last processed on start
cytadela8 Jun 15, 2025
efa5153
Rework restart logic around gateway migration
cytadela8 Jun 16, 2025
2307ea6
Genesir recovery test better logging
cytadela8 Jun 16, 2025
f3d50cb
Lint
cytadela8 Jun 16, 2025
c0f4f89
Doc comment
cytadela8 Jun 16, 2025
4e79d6f
Fix tests
cytadela8 Jun 16, 2025
d6310b8
Fix unfinalized transactions check
cytadela8 Jun 16, 2025
c49c2b7
lint .ts
cytadela8 Jun 16, 2025
09cfe86
Race condition fix
cytadela8 Jun 16, 2025
d4c5eed
Revert "More debugs ?REVERT_ME?"
cytadela8 Jun 16, 2025
c04a4d7
Remove weird type assertion
cytadela8 Jun 16, 2025
b3b44fa
refactor: consolidate queries using match_query_as macro
cytadela8 Jun 17, 2025
afab2be
style, doc
cytadela8 Jun 17, 2025
f1e7af9
Remove insert_bogus_confirmed_eth_tx function
cytadela8 Jun 17, 2025
13e1d4f
Make batch_transaction_updater configurable
cytadela8 Jun 17, 2025
11f8cc6
Test fix
cytadela8 Jun 17, 2025
b59c63a
Remove outdated comments
cytadela8 Jun 17, 2025
0c138d6
Spelling fixes
cytadela8 Jun 18, 2025
5e30894
Review fixes
cytadela8 Jun 23, 2025
cfa0378
Proper error handling of transaction status updates
cytadela8 Jun 23, 2025
c44d82c
Avoid long lasting connections
cytadela8 Jun 23, 2025
893f9e0
Proper parsing of DB AggregatedActionType
cytadela8 Jun 23, 2025
77d8f2c
review: Cleanup configs
cytadela8 Jun 23, 2025
ba8e27f
Merge remote-tracking branch 'origin/main' into apu-fast-finality-l2
cytadela8 Jun 23, 2025
0ebf12b
Proper configs
cytadela8 Jun 23, 2025
f00c78c
Test fix
cytadela8 Jun 23, 2025
0810f43
PR minor fixes
cytadela8 Jun 25, 2025
e1dd2a6
healthcheck details, formatting
cytadela8 Jun 25, 2025
246c64a
SL Client error handling
cytadela8 Jun 25, 2025
8b76915
formatting
cytadela8 Jun 25, 2025
ab5ddfd
naming
cytadela8 Jun 25, 2025
dac6802
Make L1 transaction verifier sync
cytadela8 Jun 26, 2025
fb3a7d7
style
cytadela8 Jul 1, 2025
d62aed1
Nicer and simpler error
cytadela8 Jul 1, 2025
266fb3d
Merge branch 'main' into apu-fast-finality-l2
cytadela8 Jul 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ pub enum TransactionValidationError {
TransactionFailed { tx_hash: H256 },
#[error("Database error")]
DatabaseError(#[from] zksync_dal::DalError),
#[error("SL client error")]
SlClientError(#[from] zksync_eth_client::EnrichedClientError),
#[error("Batch transaction invalid: {reason}")]
BatchTransactionInvalid { reason: String },
#[error("Other validation error")]
Expand All @@ -38,14 +36,7 @@ pub enum TransactionValidationError {

impl TransactionValidationError {
pub fn is_retryable(&self) -> bool {
match self {
TransactionValidationError::BatchNotFound { .. } => true,
TransactionValidationError::TransactionFailed { .. } => false,
TransactionValidationError::DatabaseError(_) => false,
TransactionValidationError::SlClientError(_) => false,
TransactionValidationError::BatchTransactionInvalid { .. } => false,
TransactionValidationError::OtherValidationError(_) => false,
}
matches!(self, TransactionValidationError::BatchNotFound { .. })
}
}

Expand Down
38 changes: 27 additions & 11 deletions core/node/node_sync/src/batch_transaction_updater/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,13 @@ impl BatchTransactionUpdater {
Err(e) => {
if e.is_retryable() {
tracing::warn!(
"Transaction {} cannot be verified right now",
receipt.transaction_hash
"Transaction {} cannot be verified right now due to {}",
receipt.transaction_hash,
e
);
return Ok(false);
} else {
return Err(e).with_context(|| {
format!(
"Transaction {} ({} for batch {}) verification failed",
receipt.transaction_hash, db_eth_history_tx.tx_type, batch_number,
)
});
return Err(e.into());
}
}
}
Expand Down Expand Up @@ -188,7 +184,17 @@ impl BatchTransactionUpdater {
let sent_at_block = match db_eth_tx_history.sent_at_block {
Some(block) => block,
None => {
receipt = self.sl_client.tx_receipt(db_eth_tx_history.tx_hash).await?;
receipt = match self.sl_client.tx_receipt(db_eth_tx_history.tx_hash).await {
Ok(receipt) => receipt,
Err(e) => {
tracing::warn!(
"Skipping transaction {} as failed to fetch transaction receipt: {}",
db_eth_tx_history.tx_hash,
e
);
continue;
}
};
match &receipt {
None => {
// transaction was not included, skip. We will try fetching on next iteration.
Expand All @@ -210,7 +216,7 @@ impl BatchTransactionUpdater {
};

// transaction as included, check if we can potentially update
// its finality status. This value is untrusted as seen_at_block may have been cached
// its finality status. This value is untrusted as sent_at_block may have been cached
let Some(finality_update) = l1_block_numbers
.get_finality_update(db_eth_tx_history.eth_tx_finality_status, sent_at_block)
else {
Expand All @@ -221,7 +227,17 @@ impl BatchTransactionUpdater {
// validate all properties including block number as it may
// have been cached
let receipt = if receipt.is_none() {
self.sl_client.tx_receipt(db_eth_tx_history.tx_hash).await?
match self.sl_client.tx_receipt(db_eth_tx_history.tx_hash).await {
Ok(receipt) => receipt,
Err(e) => {
tracing::warn!(
"Skipping transaction {} as failed to fetch transaction receipt: {}",
db_eth_tx_history.tx_hash,
e
);
continue;
}
}
} else {
receipt
};
Expand Down