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

fix: fixing private voting by correctly throwing an error if simulation fails #7840

Conversation

sklppy88
Copy link
Contributor

@sklppy88 sklppy88 commented Aug 8, 2024

This PR makes a simulation of a tx fail, if the tx cannot be included in a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that already exist in a state tree, the results of this simulation should not be returned, but should warn users that the transaction simulated is impossible to actually be added to a block due to being an invalid transaction.

The method for achieving the above is that a new API on the node was created, used for validating the correctness of the metadata and side-effects produced by a transaction. A transaction is deemed valid if and only if the transaction can be added to a block that can be used to advance state.

Note: this update does not make this validation necessary, and defaults to offline simulation. Offline simulation is previous non-validated behavior, and is potentially useful if we ever move to a model where a node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that fails the proof validation.

Resolves #4781.

Copy link
Contributor Author

sklppy88 commented Aug 8, 2024

@sklppy88 sklppy88 force-pushed the ek/fix/4781/breaking-private-voting-test-by-expecting-simulation-to-fail branch from b535eb9 to cd88639 Compare August 8, 2024 10:34
@sklppy88 sklppy88 force-pushed the ek/fix/4781/transaction-simulation-should-be-validated branch from a51d888 to 71e587c Compare August 8, 2024 10:34
@sklppy88 sklppy88 changed the title init fix: fixing private voting by correctly throwing an error if simulation fails Aug 8, 2024
@sklppy88 sklppy88 force-pushed the ek/fix/4781/breaking-private-voting-test-by-expecting-simulation-to-fail branch from cd88639 to e73e86d Compare August 8, 2024 11:36
@sklppy88 sklppy88 force-pushed the ek/fix/4781/transaction-simulation-should-be-validated branch from 71e587c to 2a464b1 Compare August 8, 2024 11:36
@AztecBot
Copy link
Collaborator

AztecBot commented Aug 8, 2024

Benchmark results

Metrics with a significant change:

  • protocol_circuit_simulation_time_in_ms (private-kernel-tail-to-public): 2,361 (-31%)
  • public_db_access_time_ms (get-nullifier-index): 0.566 (+255%)
  • avm_simulation_time_ms (Token:mint_public): 371 (+353%)
  • avm_simulation_time_ms (Token:transfer_public): 21.5 (-48%)
  • avm_simulation_time_ms (Token:_increase_public_balance): 78.1 (+658%)
  • avm_simulation_time_ms (FPC:pay_refund_with_shielded_rebate): 74.2 (-46%)
  • protocol_circuit_witness_generation_time_in_ms (base-parity): 279 (-54%)
  • protocol_circuit_proving_time_in_ms (base-parity): 1,068 (-39%)
Detailed results

All benchmarks are run on txs on the Benchmarking contract on the repository. Each tx consists of a batch call to create_note and increment_balance, which guarantees that each tx has a private call, a nested private call, a public call, and a nested public call, as well as an emitted private note, an unencrypted log, and public storage read and write.

This benchmark source data is available in JSON format on S3 here.

Proof generation

Each column represents the number of threads used in proof generation.

Metric 1 threads 4 threads 16 threads 32 threads 64 threads
proof_construction_time_sha256_ms 5,757 (+1%) 1,559 (+1%) 709 (+1%) 748 767
proof_construction_time_sha256_30_ms 11,818 (+4%) 3,174 (+3%) 1,408 1,440 (+1%) 1,472 (+1%)
proof_construction_time_sha256_100_ms 44,166 (+4%) 12,601 (+5%) 5,717 (+3%) 5,592 (+1%) 5,524 (+3%)
proof_construction_time_poseidon_hash_ms 78.0 34.0 34.0 59.0 (-2%) 89.0 (+1%)
proof_construction_time_poseidon_hash_30_ms 1,531 (+1%) 420 (+1%) 202 (+1%) 230 (+6%) 269 (+1%)
proof_construction_time_poseidon_hash_100_ms 5,653 (+2%) 1,533 (+1%) 681 (+1%) 745 (+2%) 750 (+1%)

L2 block published to L1

Each column represents the number of txs on an L2 block published to L1.

Metric 4 txs 8 txs 16 txs
l1_rollup_calldata_size_in_bytes 740 740 740
l1_rollup_calldata_gas 6,704 6,712 6,704
l1_rollup_execution_gas 611,971 612,130 612,273
l2_block_processing_time_in_ms 256 (+1%) 446 823 (+2%)
l2_block_building_time_in_ms 9,581 (-1%) 18,966 37,237 (-1%)
l2_block_rollup_simulation_time_in_ms 9,581 (-1%) 18,966 37,236 (-1%)
l2_block_public_tx_process_time_in_ms 7,953 (-1%) 17,143 35,356 (-1%)

L2 chain processing

Each column represents the number of blocks on the L2 chain where each block has 8 txs.

Metric 3 blocks 5 blocks
node_history_sync_time_in_ms 2,817 (+1%) 3,567 (-4%)
node_database_size_in_bytes 12,709,968 16,883,792
pxe_database_size_in_bytes 16,254 26,813

Circuits stats

Stats on running time and I/O sizes collected for every kernel circuit run across all benchmarks.

Circuit simulation_time_in_ms witness_generation_time_in_ms input_size_in_bytes output_size_in_bytes proving_time_in_ms proof_size_in_bytes num_public_inputs size_in_gates
private-kernel-init 96.7 (+2%) 412 (+1%) 21,846 44,858 N/A N/A N/A N/A
private-kernel-inner 175 (+1%) 727 (+5%) 72,545 45,005 N/A N/A N/A N/A
private-kernel-tail 681 825 53,216 50,574 N/A N/A N/A N/A
base-parity 6.05 (+3%) ⚠️ 279 (-54%) 160 96.0 ⚠️ 1,068 (-39%) 13,188 19.0 65,536
root-parity 110 113 (-13%) 69,084 96.0 27,981 (-9%) 13,188 19.0 4,194,304
base-rollup 2,967 (-1%) 5,555 (+3%) 182,736 664 86,567 (-13%) 14,020 45.0 16,777,216
root-rollup 98.1 (+1%) 106 (-6%) 54,525 716 25,249 (-11%) 13,988 44.0 4,194,304
public-kernel-setup 91.0 2,746 (-2%) 103,513 70,710 15,378 (-13%) 128,708 3,629 2,097,152
public-kernel-app-logic 106 (+1%) 4,171 (+1%) 103,513 70,710 8,724 (-14%) 128,708 3,629 1,048,576
public-kernel-tail 588 (+1%) 26,917 (-15%) 403,238 11,326 92,831 (-10%) 27,204 457 16,777,216
private-kernel-reset-tiny 194 (+5%) 877 (+5%) 68,621 44,750 N/A N/A N/A N/A
private-kernel-tail-to-public ⚠️ 2,361 (-31%) 1,588 (+2%) 942,862 1,697 N/A N/A N/A N/A
public-kernel-teardown 87.0 4,167 (+2%) 103,513 70,710 16,287 (-13%) 128,708 3,629 2,097,152
merge-rollup 59.7 N/A 35,742 664 N/A N/A N/A N/A
undefined N/A N/A N/A N/A 69,582 (-2%) N/A N/A N/A

Stats on running time collected for app circuits

Function input_size_in_bytes output_size_in_bytes witness_generation_time_in_ms proof_size_in_bytes proving_time_in_ms
ContractClassRegisterer:register 1,344 11,731 345 (+2%) N/A N/A
ContractInstanceDeployer:deploy 1,408 11,731 18.3 N/A N/A
MultiCallEntrypoint:entrypoint 1,920 11,731 478 N/A N/A
FeeJuice:deploy 1,376 11,731 388 (+2%) N/A N/A
SchnorrAccount:constructor 1,312 11,731 177 (+1%) N/A N/A
SchnorrAccount:entrypoint 2,304 11,731 539 N/A N/A
Token:privately_mint_private_note 1,280 11,731 222 (-1%) N/A N/A
FPC:fee_entrypoint_public 1,344 11,731 31.7 (+2%) N/A N/A
Token:transfer 1,312 11,731 458 (+3%) N/A N/A
AuthRegistry:set_authorized (avm) 18,491 N/A N/A 147,296 2,698 (+9%)
FPC:prepare_fee (avm) 22,958 N/A N/A 147,360 3,327 (+4%)
Token:transfer_public (avm) 61,614 N/A N/A 147,360 17,688 (-2%)
AuthRegistry:consume (avm) 41,719 N/A N/A 147,328 7,496 (+1%)
FPC:pay_refund (avm) 26,227 N/A N/A 147,328 7,208 (-3%)
Benchmarking:create_note 1,344 11,731 169 (-1%) N/A N/A
SchnorrAccount:verify_private_authwit 1,280 11,731 27.4 N/A N/A
Token:unshield 1,376 11,731 729 (-1%) N/A N/A
FPC:fee_entrypoint_private 1,376 11,731 965 (-1%) N/A N/A

AVM Simulation

Time to simulate various public functions in the AVM.

Function time_ms bytecode_size_in_bytes
FeeJuice:_increase_public_balance 94.5 (-1%) 8,139
FeeJuice:set_portal 9.91 (-27%) 2,362
Token:constructor 122 (-1%) 31,107
FPC:constructor 92.7 22,380
FeeJuice:mint_public 85.2 (+10%) 6,150
Token:mint_public ⚠️ 371 (+353%) 11,720
Token:assert_minter_and_mint 80.3 (-9%) 8,028
AuthRegistry:set_authorized 8.28 (-21%) 4,537
FPC:prepare_fee 282 (-5%) 8,812
Token:transfer_public ⚠️ 21.5 (-48%) 47,374
FPC:pay_refund 62.6 (-3%) 12,114
Benchmarking:increment_balance 1,024 (+1%) 7,450
Token:_increase_public_balance ⚠️ 78.1 (+658%) 8,960
FPC:pay_refund_with_shielded_rebate ⚠️ 74.2 (-46%) 12,663

Public DB Access

Time to access various public DBs.

Function time_ms
get-nullifier-index ⚠️ 0.566 (+255%)

Tree insertion stats

The duration to insert a fixed batch of leaves into each tree type.

Metric 1 leaves 16 leaves 64 leaves 128 leaves 256 leaves 512 leaves 1024 leaves
batch_insert_into_append_only_tree_16_depth_ms 2.16 (+1%) 4.04 (+4%) N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_count 16.8 31.7 N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.112 (+1%) 0.112 (+3%) N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 11.5 (+3%) 17.5 (-3%) 30.0 (-4%) 58.8 (-1%) 112 (-1%)
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 95.9 159 287 543 1,055
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A 0.110 (+2%) 0.102 (-3%) 0.0992 (-2%) 0.102 0.101 (-1%)
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 14.5 (+1%) 25.5 43.0 (-3%) 82.7 161
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 109 207 355 691 1,363
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.110 (+1%) 0.103 0.105 (-2%) 0.102 0.103
batch_insert_into_indexed_tree_40_depth_ms N/A N/A 16.6 (+1%) N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A 132 N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A 0.106 (+1%) N/A N/A N/A N/A

Miscellaneous

Transaction sizes based on how many contract classes are registered in the tx.

Metric 0 registered classes 1 registered classes
tx_size_in_bytes 63,593 665,008

Transaction size based on fee payment method

| Metric | |
| - | |

@sklppy88 sklppy88 force-pushed the ek/fix/4781/transaction-simulation-should-be-validated branch from 2a464b1 to ea59527 Compare August 8, 2024 14:51
@sklppy88 sklppy88 force-pushed the ek/fix/4781/transaction-simulation-should-be-validated branch from ea59527 to 2f4d23a Compare August 8, 2024 15:03
@sklppy88 sklppy88 requested a review from nventuro August 8, 2024 15:36
@sklppy88 sklppy88 marked this pull request as ready for review August 8, 2024 15:36
@sklppy88 sklppy88 merged commit e3794ed into ek/fix/4781/breaking-private-voting-test-by-expecting-simulation-to-fail Aug 9, 2024
100 of 101 checks passed
@sklppy88 sklppy88 deleted the ek/fix/4781/transaction-simulation-should-be-validated branch August 9, 2024 17:27
sklppy88 added a commit that referenced this pull request Aug 12, 2024
…on fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.
sklppy88 added a commit that referenced this pull request Aug 12, 2024
…on fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.
sklppy88 added a commit that referenced this pull request Aug 13, 2024
…on fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.
sklppy88 added a commit that referenced this pull request Aug 13, 2024
fix: fixing private voting by correctly throwing an error if simulation fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.

Apply suggestions from code review

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
sklppy88 added a commit that referenced this pull request Aug 13, 2024
fix: fixing private voting by correctly throwing an error if simulation fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.

Apply suggestions from code review

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
sklppy88 added a commit that referenced this pull request Aug 18, 2024
fix: fixing private voting by correctly throwing an error if simulation fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.

Apply suggestions from code review

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
sklppy88 added a commit that referenced this pull request Aug 26, 2024
fix: fixing private voting by correctly throwing an error if simulation fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.

Apply suggestions from code review

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
sklppy88 added a commit that referenced this pull request Aug 27, 2024
fix: fixing private voting by correctly throwing an error if simulation fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.

Apply suggestions from code review

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
sklppy88 added a commit that referenced this pull request Aug 27, 2024
fix: fixing private voting by correctly throwing an error if simulation fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.

Apply suggestions from code review

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
sklppy88 added a commit that referenced this pull request Aug 27, 2024
fix: fixing private voting by correctly throwing an error if simulation fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.

Apply suggestions from code review

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
sklppy88 added a commit that referenced this pull request Aug 27, 2024
fix: fixing private voting by correctly throwing an error if simulation fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.

Apply suggestions from code review

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
sklppy88 added a commit that referenced this pull request Aug 28, 2024
fix: fixing private voting by correctly throwing an error if simulation fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.

Apply suggestions from code review

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
sklppy88 added a commit that referenced this pull request Aug 28, 2024
fix: fixing private voting by correctly throwing an error if simulation fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.

Apply suggestions from code review

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
sklppy88 added a commit that referenced this pull request Aug 28, 2024
fix: fixing private voting by correctly throwing an error if simulation fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.

Apply suggestions from code review

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
sklppy88 added a commit that referenced this pull request Aug 28, 2024
fix: fixing private voting by correctly throwing an error if simulation fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.

Apply suggestions from code review

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
sklppy88 added a commit that referenced this pull request Aug 28, 2024
fix: fixing private voting by correctly throwing an error if simulation fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.

Apply suggestions from code review

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
sklppy88 added a commit that referenced this pull request Aug 28, 2024
fix: fixing private voting by correctly throwing an error if simulation fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.

Apply suggestions from code review

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
sklppy88 added a commit that referenced this pull request Aug 28, 2024
fix: fixing private voting by correctly throwing an error if simulation fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.

Apply suggestions from code review

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
sklppy88 added a commit that referenced this pull request Aug 29, 2024
fix: fixing private voting by correctly throwing an error if simulation fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.

Apply suggestions from code review

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
sklppy88 added a commit that referenced this pull request Aug 29, 2024
fix: fixing private voting by correctly throwing an error if simulation fails (#7840)

This PR makes a simulation of a tx fail, if the tx cannot be included in
a block and added to the state.

e.g. If a simulation produces duplicate nullifiers, or nullifiers that
already exist in a state tree, the results of this simulation should not
be returned, but should warn users that the transaction simulated is
impossible to actually be added to a block due to being an invalid
transaction.

The method for achieving the above is that a new API on the node was
created, used for validating the correctness of the metadata and
side-effects produced by a transaction. A transaction is deemed valid if
and only if the transaction can be added to a block that can be used to
advance state.

Note: this update does not make this validation necessary, and defaults
to offline simulation. Offline simulation is previous non-validated
behavior, and is potentially useful if we ever move to a model where a
node is optional to a pxe.

Another note just for reference: there is weirdness in e2e_prover, that
fails the proof validation.

Resolves #4781.

Apply suggestions from code review

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
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.

2 participants