Currently a chunk producer validates transactions before applying a chunk by calling validate_chunk_transactions, which does not validate individual transactions. On the other hand, a chunk validator validates each individual transaction before applying the chunk by calling validate_prepared_transactions. The problem is not only that these two code paths are not consistent, but also that chunk validators call verify_and_charge_transaction twice during the validation of a chunk, once in validate_prepared_transactions and once in apply_new_chunk. The call to verify_and_charge_transaction can be expensive because it involves signature verification. We should fix it so that chunk validators follow the same transaction validation path and avoid calling verify_and_charge_transaction twice during chunk validation.
Currently a chunk producer validates transactions before applying a chunk by calling
validate_chunk_transactions
, which does not validate individual transactions. On the other hand, a chunk validator validates each individual transaction before applying the chunk by callingvalidate_prepared_transactions
. The problem is not only that these two code paths are not consistent, but also that chunk validators callverify_and_charge_transaction
twice during the validation of a chunk, once invalidate_prepared_transactions
and once inapply_new_chunk
. The call toverify_and_charge_transaction
can be expensive because it involves signature verification. We should fix it so that chunk validators follow the same transaction validation path and avoid callingverify_and_charge_transaction
twice during chunk validation.