Skip to content

Commit

Permalink
Add serialization compatibility test for transaction index (#1673)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbearer authored Jul 3, 2024
2 parents 8c25dad + 87ea487 commit 699b0ed
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 27 deletions.
Binary file modified data/header.bin
Binary file not shown.
10 changes: 5 additions & 5 deletions data/header.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"block_merkle_tree_root": "MERKLE_COMM~AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAQA",
"builder_commitment": "BUILDER_COMMITMENT~upd4eFij7NNHTMYiVQoL-hDBw3bJiOMmCoNJxxgGwJ6h",
"builder_commitment": "BUILDER_COMMITMENT~jlEvJoHPETCSwXF6UKcD22zOjfoHGuyVFTVkP_BNc-no",
"builder_signature": {
"r": "0xc7b7c4062ada11d09530d759af4f2d9d84dd2d1ca6117299dee9b36e039642b6",
"s": "0x10cc3c7c0d0d69ba19348c720ee95cbb48470b9181cc32c9922af86b83fba9a2",
"r": "0xa1c3795850b7b490e616b60fead89753841fbc9fffe1a939d483f1d959ad1c45",
"s": "0x20228f5b63b14792d371dce479978e45020f19602189ef6d325b73029a2848ac",
"v": 27
},
"chain_config": {
Expand All @@ -30,8 +30,8 @@
},
"l1_head": 124,
"ns_table": {
"bytes": "AQAAAO7/wAAIBAAA"
"bytes": "AwAAAO7/wAAcBgAAobC5EkAOAABksAWiXBQAAA=="
},
"payload_commitment": "HASH~Ojg3e_G9UzTwOygEDDcbvgakaVCqMByIiFrlkLXT72qf",
"payload_commitment": "HASH~u-mEo1mwByROUhnvO7pBFitcD0UEvruK-b8WONkKoCLQ",
"timestamp": 789
}
Binary file modified data/ns_table.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion data/ns_table.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"bytes": "AQAAAO7/wAAIBAAA"
"bytes": "AwAAAO7/wAAcBgAAobC5EkAOAABksAWiXBQAAA=="
}
Binary file modified data/payload.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions data/payload.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ns_table": {
"bytes": "AQAAAO7/wAAIBAAA"
"bytes": "AwAAAO7/wAAcBgAAobC5EkAOAABksAWiXBQAAA=="
},
"raw_payload": "AQAAAAAEAAAAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1+f4CBgoOEhYaHiImKi4yNjo+QkZKTlJWWl5iZmpucnZ6foKGio6SlpqeoqaqrrK2ur7CxsrO0tba3uLm6u7y9vr/AwcLDxMXGx8jJysvMzc7P0NHS09TV1tfY2drb3N3e3+Dh4uPk5ebn6Onq6+zt7u/w8fLz9PX29/j5+vv8/f4AAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1+f4CBgoOEhYaHiImKi4yNjo+QkZKTlJWWl5iZmpucnZ6foKGio6SlpqeoqaqrrK2ur7CxsrO0tba3uLm6u7y9vr/AwcLDxMXGx8jJysvMzc7P0NHS09TV1tfY2drb3N3e3+Dh4uPk5ebn6Onq6+zt7u/w8fLz9PX29/j5+vv8/f4AAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc3R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MfHU5Lfd917BM9ip0oOe8y4GLDCscgs/6lUTzO0g30OzZVvlsdOk2pSNRbrbrnhy6HCGsxPxAYuyIJ93ZmHaZ+hEiq1KgISHq7bIxV7ffUEZIZ3+RyTWsvJGB82C027X1NXcrLRtmfJ9L9oUask0rqNz7elKvd8FFET54rUaDOx/dorXjMwoWuxHnViT+jYwsSA+73kiOA5H0Q4y0XT6F58/wo7JSR3hS2PQNPtsuLgX4ZIadYn4njN3w7Uocuz48iw/JYLIM+AlrW16RgduDVr0YhVIcMVAeeeizNM/wkfulryWH5LvDqJ6oH6ir9b5NX5f82FPE7o2p7shS1I02wV3zPpoqcOn4C1z9LC1V0twA4xSRyQc0nmcWZMpIR3/IkSIMRdMa/OB2WsJza/u+DOzJ6HcDfLtqNNIpm/ksVqJiQWkl48B2rCv26KDkRwXFoLopuT2KRlB1kRFew7lNRaTQesbiGMrYFd98AHjDJzuA6197J5c7XgRA7EVaFK72Rbzsudh2oHun/ninbEHNDvEtYrBlZszVJ48a+EL8X/r8gMwoi7Wq33dhwFaDmIezr0/A9RjJELXTEtczYQwt3SP/vkSqjqwbC0LNJVsvoqf8QpkTmfBFyEtakDYgSqOqAei92d3d1yBIq+HFQu4wy83N25zw3fSMJXJixQwp7QEIScYLxQP/9Q3NGiV1QtxGUMdu1bGVTvjcvmNx6sezGBjleuHUBYlF9+y8yVWc3dOyQ9EqEMomqZ4fkeBvNgElGjPTH2SA9nl0ZVKM4EgQ1cvRUYwBWtFYkrfcZquK/G6+/REOOB4Q+xIIcxbsrzCI0DYsFLllEVKIfWLbdJH2WwWINsP96rBhh3aLnTeM0srC3IuZfjI+wgpXnEyMqdWJ1rqjrkMBZHvjecJmWaUhFFmBE22RGJ544P1PsMp/pVEFPGMdb+sSuqhuA88XnuYKI8ENxLXXTHE/to1mQ9khDnpntjARASxeSAFmEddAmrfSoh9JV3P49YR8QBlWAyVPt/aw=="
}
Binary file modified data/transaction.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions data/transaction.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"namespace": 12648430,
"payload": "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+AAECAw=="
}
"payload": "vj8cymNUwpTPZMCY3qItBACelLfb+2v0bng7fk/U3aoEfKP36cdVglIDjBkk3D5Dpz9jZLgthi81fsxCGod7uMTy40NZUWR69skwH9gd67REz6ar2K9OuVPwKG3F3Vg973TIrwKTP3plY4Lu6hW6El2AgT5q9qqgmZ3XwnIpZ1lfbAIJ7Ngn6RRTXFsa+jtLb0goXSQtALN69RHcntnqe3q2Ao02ZTxWkspFf0GPgOtCVh6/NcftJfP7D/wDNF+7mT4fCUn7jzySd0oc/BNFtAx8inCSJyZLrOCRhjkiBd8VNjrWUx9mA76WZpIRSlUwIooO2MzeQwL/mkbJjojVQg=="
}
Binary file added data/tx_index.bin
Binary file not shown.
14 changes: 14 additions & 0 deletions data/tx_index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"ns_index": [
2,
0,
0,
0
],
"tx_index": [
5,
0,
0,
0
]
}
60 changes: 43 additions & 17 deletions sequencer/src/reference_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@
//! test.

use crate::{
block::NsTable, state::FeeInfo, ChainConfig, FeeAccount, Header, L1BlockInfo, Payload,
Transaction, ValidatedState,
block::NsTable, state::FeeInfo, ChainConfig, FeeAccount, Header, L1BlockInfo, NamespaceId,
Payload, SeqTypes, Transaction, ValidatedState,
};
use async_compatibility_layer::logging::{setup_backtrace, setup_logging};
use committable::Committable;
use es_version::SequencerVersion;
use hotshot_query_service::availability::QueryablePayload;
use hotshot_types::traits::{
block_contents::vid_commitment, signature_key::BuilderSignatureKey, BlockPayload, EncodeBytes,
};
use jf_merkle_tree::MerkleTreeScheme;
use pretty_assertions::assert_eq;
use rand::{Rng, RngCore};
use sequencer_utils::commitment_to_u256;
use serde::{de::DeserializeOwned, Serialize};
use serde_json::Value;
Expand All @@ -43,21 +45,31 @@ use vbs::BinarySerializer;
type Serializer = vbs::Serializer<SequencerVersion>;

async fn reference_payload() -> Payload {
Payload::from_transactions(
vec![reference_transaction()],
&Default::default(),
&Default::default(),
)
.await
.unwrap()
.0
const NUM_NS_IDS: usize = 3;
let ns_ids: [NamespaceId; NUM_NS_IDS] = [12648430.into(), 314159265.into(), 2718281828.into()];

let mut rng = jf_utils::test_rng();
let txs = {
const NUM_TXS: usize = 20;
let mut txs = Vec::with_capacity(NUM_TXS);
for _ in 0..NUM_TXS {
let ns_id = ns_ids[rng.gen_range(0..NUM_NS_IDS)];
txs.push(reference_transaction(ns_id, &mut rng));
}
txs
};

Payload::from_transactions(txs, &Default::default(), &Default::default())
.await
.unwrap()
.0
}

async fn reference_ns_table() -> NsTable {
reference_payload().await.ns_table().clone()
}

const REFERENCE_NS_TABLE_COMMITMENT: &str = "NSTABLE~jqBfNUW1lSijWpKpPNc9yxQs28YckB80gFJWnHIwOQMC";
const REFERENCE_NS_TABLE_COMMITMENT: &str = "NSTABLE~tMW0-hGn0563bgYgvsO9r95f2AUiTD_2tvjDOuGRwNA5";

fn reference_l1_block() -> L1BlockInfo {
L1BlockInfo {
Expand Down Expand Up @@ -126,14 +138,23 @@ async fn reference_header() -> Header {
}
}

const REFERENCE_HEADER_COMMITMENT: &str = "BLOCK~mHlaknD1qKCz0UBtV2GpnqfO6gFqF5yN-9qkmLMRG3rp";
const REFERENCE_HEADER_COMMITMENT: &str = "BLOCK~dh1KpdvvxSvnnPpOi2yI3DOg8h6ltr2Kv13iRzbQvtN2";

fn reference_transaction() -> Transaction {
let payload: [u8; 1024] = std::array::from_fn(|i| (i % (u8::MAX as usize)) as u8);
Transaction::new(12648430.into(), payload.to_vec())
fn reference_transaction<R>(ns_id: NamespaceId, rng: &mut R) -> Transaction
where
R: RngCore,
{
let mut tx_payload = vec![0u8; 256];
rng.fill_bytes(&mut tx_payload);
Transaction::new(ns_id, tx_payload)
}

const REFERENCE_TRANSACTION_COMMITMENT: &str = "TX~jmYCutMVgguprgpZHywPwkehwXfibQx951gh4LSLmfwp";
const REFERENCE_TRANSACTION_COMMITMENT: &str = "TX~EikfLslj3g6sIWRZYpN6ZuU1gadN77AHXmRA56yNnPrQ";

async fn reference_tx_index() -> <Payload as QueryablePayload<SeqTypes>>::TransactionIndex {
let payload = reference_payload().await;
payload.iter(payload.ns_table()).last().unwrap()
}

fn reference_test_without_committable<T: Serialize + DeserializeOwned + Eq + Debug>(
name: &str,
Expand Down Expand Up @@ -256,6 +277,11 @@ async fn test_reference_payload() {
reference_test_without_committable("payload", &reference_payload().await);
}

#[async_std::test]
async fn test_reference_tx_index() {
reference_test_without_committable("tx_index", &reference_tx_index().await);
}

#[async_std::test]
async fn test_reference_ns_table() {
reference_test(
Expand Down Expand Up @@ -305,7 +331,7 @@ async fn test_reference_header() {
fn test_reference_transaction() {
reference_test(
"transaction",
reference_transaction(),
reference_transaction(12648430.into(), &mut jf_utils::test_rng()),
REFERENCE_TRANSACTION_COMMITMENT,
);
}

0 comments on commit 699b0ed

Please sign in to comment.