Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/add-input-field-to-call-request'…
Browse files Browse the repository at this point in the history
… into add-input-field-to-call-request
  • Loading branch information
Artemka374 committed Feb 14, 2024
2 parents 4fffd70 + b707c15 commit 16c8bb8
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 6 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/lib/dal/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ async fn workflow_with_submit_tx_equal_hashes() {
.insert_transaction_l2(tx, mock_tx_execution_metrics())
.await;

assert_eq!(result, L2TxSubmissionResult::Replaced);
assert_eq!(result, L2TxSubmissionResult::Duplicate);
}

#[tokio::test]
Expand Down
22 changes: 22 additions & 0 deletions core/lib/dal/src/transactions_dal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,27 @@ impl TransactionsDal<'_, '_> {
) -> L2TxSubmissionResult {
{
let tx_hash = tx.hash();
let is_duplicate = sqlx::query!(
r#"
SELECT
TRUE
FROM
transactions
WHERE
hash = $1
"#,
tx_hash.as_bytes(),
)
.fetch_optional(self.storage.conn())
.await
.unwrap()
.is_some();

if is_duplicate {
tracing::debug!("Prevented inserting duplicate L2 transaction {tx_hash:?} to DB");
return L2TxSubmissionResult::Duplicate;
}

let initiator_address = tx.initiator_account();
let contract_address = tx.execute.contract_address.as_bytes();
let json_data = serde_json::to_value(&tx.execute)
Expand Down Expand Up @@ -411,6 +432,7 @@ impl TransactionsDal<'_, '_> {
if let error::Error::Database(ref error) = err {
if let Some(constraint) = error.constraint() {
if constraint == "transactions_pkey" {
tracing::debug!("Attempted to insert duplicate L2 transaction {tx_hash:?} to DB");
return L2TxSubmissionResult::Duplicate;
}
}
Expand Down
4 changes: 2 additions & 2 deletions core/lib/multivm/src/tracers/call_tracer/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use vise::{Buckets, Histogram, Metrics};
#[metrics(prefix = "vm_call_tracer")]
pub struct CallMetrics {
/// Maximum call stack depth during the execution of the transaction.
#[metrics(buckets = Buckets::exponential(1.0..=64.0, 2.0))]
#[metrics(buckets = Buckets::exponential(1.0..=1024.0, 2.0))]
pub call_stack_depth: Histogram<usize>,
/// Maximum number of near calls during the execution of the transaction.
#[metrics(buckets = Buckets::exponential(1.0..=64.0, 2.0))]
#[metrics(buckets = Buckets::exponential(1.0..=1024.0, 2.0))]
pub max_near_calls: Histogram<usize>,
}

Expand Down
4 changes: 2 additions & 2 deletions docker/contract-verifier/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN apt-get update && apt-get install -y curl libpq5 ca-certificates wget python

# install zksolc 1.3.x
RUN skip_versions="v1.3.12 v1.3.15 v1.3.20" && \
for VERSION in $(seq -f "v1.3.%g" 0 22); do \
for VERSION in $(seq -f "v1.3.%g" 0 23); do \
if echo " $skip_versions " | grep -q -w " $VERSION "; then \
continue; \
fi; \
Expand All @@ -22,7 +22,7 @@ RUN skip_versions="v1.3.12 v1.3.15 v1.3.20" && \
done

# install zkvyper 1.3.x
RUN for VERSION in $(seq -f "v1.3.%g" 9 16); do \
RUN for VERSION in $(seq -f "v1.3.%g" 9 17); do \
mkdir -p /etc/zkvyper-bin/$VERSION && \
wget https://github.com/matter-labs/zkvyper-bin/raw/main/linux-amd64/zkvyper-linux-amd64-musl-$VERSION -O /etc/zkvyper-bin/$VERSION/zkvyper && \
chmod +x /etc/zkvyper-bin/$VERSION/zkvyper; \
Expand Down
2 changes: 1 addition & 1 deletion docker/contract-verifier/install-all-solc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ do
done

# Download zkVM solc
list=("0.8.23-1.0.0" "0.8.22-1.0.0" "0.8.21-1.0.0" "0.8.20-1.0.0" "0.8.19-1.0.0" "0.8.18-1.0.0" "0.8.17-1.0.0" "0.8.16-1.0.0" "0.8.15-1.0.0" "0.8.14-1.0.0" "0.8.13-1.0.0" "0.8.12-1.0.0" "0.8.11-1.0.0" "0.8.10-1.0.0" "0.8.9-1.0.0" "0.8.8-1.0.0" "0.8.7-1.0.0" "0.8.6-1.0.0" "0.8.5-1.0.0" "0.8.4-1.0.0" "0.8.3-1.0.0" "0.8.2-1.0.0" "0.8.1-1.0.0" "0.8.0-1.0.0" "0.7.6-1.0.0" "0.7.5-1.0.0" "0.7.4-1.0.0" "0.7.3-1.0.0" "0.7.2-1.0.0" "0.7.1-1.0.0" "0.7.0-1.0.0" "0.6.12-1.0.0" "0.6.11-1.0.0" "0.6.10-1.0.0" "0.6.9-1.0.0" "0.6.8-1.0.0" "0.6.7-1.0.0" "0.6.6-1.0.0" "0.6.5-1.0.0" "0.6.4-1.0.0" "0.6.3-1.0.0" "0.6.2-1.0.0" "0.6.1-1.0.0" "0.6.0-1.0.0" "0.5.17-1.0.0" "0.5.16-1.0.0" "0.5.15-1.0.0" "0.5.14-1.0.0" "0.5.13-1.0.0" "0.5.12-1.0.0" "0.5.11-1.0.0" "0.5.10-1.0.0" "0.5.9-1.0.0" "0.5.8-1.0.0" "0.5.7-1.0.0" "0.5.6-1.0.0" "0.5.5-1.0.0" "0.5.4-1.0.0" "0.5.3-1.0.0" "0.5.2-1.0.0" "0.5.1-1.0.0" "0.5.0-1.0.0" "0.4.26-1.0.0" "0.4.25-1.0.0" "0.4.24-1.0.0" "0.4.23-1.0.0" "0.4.22-1.0.0" "0.4.21-1.0.0" "0.4.20-1.0.0" "0.4.19-1.0.0" "0.4.18-1.0.0" "0.4.17-1.0.0" "0.4.16-1.0.0" "0.4.15-1.0.0" "0.4.14-1.0.0" "0.4.13-1.0.0" "0.4.12-1.0.0")
list=("0.8.24-1.0.0" "0.8.23-1.0.0" "0.8.22-1.0.0" "0.8.21-1.0.0" "0.8.20-1.0.0" "0.8.19-1.0.0" "0.8.18-1.0.0" "0.8.17-1.0.0" "0.8.16-1.0.0" "0.8.15-1.0.0" "0.8.14-1.0.0" "0.8.13-1.0.0" "0.8.12-1.0.0" "0.8.11-1.0.0" "0.8.10-1.0.0" "0.8.9-1.0.0" "0.8.8-1.0.0" "0.8.7-1.0.0" "0.8.6-1.0.0" "0.8.5-1.0.0" "0.8.4-1.0.0" "0.8.3-1.0.0" "0.8.2-1.0.0" "0.8.1-1.0.0" "0.8.0-1.0.0" "0.7.6-1.0.0" "0.7.5-1.0.0" "0.7.4-1.0.0" "0.7.3-1.0.0" "0.7.2-1.0.0" "0.7.1-1.0.0" "0.7.0-1.0.0" "0.6.12-1.0.0" "0.6.11-1.0.0" "0.6.10-1.0.0" "0.6.9-1.0.0" "0.6.8-1.0.0" "0.6.7-1.0.0" "0.6.6-1.0.0" "0.6.5-1.0.0" "0.6.4-1.0.0" "0.6.3-1.0.0" "0.6.2-1.0.0" "0.6.1-1.0.0" "0.6.0-1.0.0" "0.5.17-1.0.0" "0.5.16-1.0.0" "0.5.15-1.0.0" "0.5.14-1.0.0" "0.5.13-1.0.0" "0.5.12-1.0.0" "0.5.11-1.0.0" "0.5.10-1.0.0" "0.5.9-1.0.0" "0.5.8-1.0.0" "0.5.7-1.0.0" "0.5.6-1.0.0" "0.5.5-1.0.0" "0.5.4-1.0.0" "0.5.3-1.0.0" "0.5.2-1.0.0" "0.5.1-1.0.0" "0.5.0-1.0.0" "0.4.26-1.0.0" "0.4.25-1.0.0" "0.4.24-1.0.0" "0.4.23-1.0.0" "0.4.22-1.0.0" "0.4.21-1.0.0" "0.4.20-1.0.0" "0.4.19-1.0.0" "0.4.18-1.0.0" "0.4.17-1.0.0" "0.4.16-1.0.0" "0.4.15-1.0.0" "0.4.14-1.0.0" "0.4.13-1.0.0" "0.4.12-1.0.0")
for version in ${list[@]};
do
mkdir -p etc/solc-bin/zkVM-$version/
Expand Down

0 comments on commit 16c8bb8

Please sign in to comment.