From f11458fe75f94cc36d3beea9b18dd70d28314749 Mon Sep 17 00:00:00 2001 From: Jeb Bearer Date: Wed, 3 Jul 2024 11:02:51 -0400 Subject: [PATCH 1/3] Add serialization compatibility test for transaction index --- data/tx_index.bin | Bin 0 -> 12 bytes data/tx_index.json | 4 ++++ sequencer/src/reference_tests.rs | 13 ++++++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 data/tx_index.bin create mode 100644 data/tx_index.json diff --git a/data/tx_index.bin b/data/tx_index.bin new file mode 100644 index 0000000000000000000000000000000000000000..44a00b6448f67d3b639cb3afe406c42c4f8eef27 GIT binary patch literal 12 McmZQzU}S&+000&M0ssI2 literal 0 HcmV?d00001 diff --git a/data/tx_index.json b/data/tx_index.json new file mode 100644 index 0000000000..4ab97ba604 --- /dev/null +++ b/data/tx_index.json @@ -0,0 +1,4 @@ +{ + "ns_index": [0, 0, 0, 0], + "tx_index": [0, 0, 0, 0] +} diff --git a/sequencer/src/reference_tests.rs b/sequencer/src/reference_tests.rs index a76d3a7fbb..abcfbf6a3b 100644 --- a/sequencer/src/reference_tests.rs +++ b/sequencer/src/reference_tests.rs @@ -23,11 +23,12 @@ use crate::{ block::NsTable, state::FeeInfo, ChainConfig, FeeAccount, Header, L1BlockInfo, Payload, - Transaction, ValidatedState, + 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, }; @@ -135,6 +136,11 @@ fn reference_transaction() -> Transaction { const REFERENCE_TRANSACTION_COMMITMENT: &str = "TX~jmYCutMVgguprgpZHywPwkehwXfibQx951gh4LSLmfwp"; +async fn reference_tx_index() -> >::TransactionIndex { + let payload = reference_payload().await; + payload.iter(payload.ns_table()).next().unwrap() +} + fn reference_test_without_committable( name: &str, reference: &T, @@ -256,6 +262,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( From a1c256503d52d8dfff8ff16130d41c110ac4d3d6 Mon Sep 17 00:00:00 2001 From: Gus Gutoski Date: Wed, 3 Jul 2024 11:46:21 -0400 Subject: [PATCH 2/3] nontrivial reference test for tx index --- data/tx_index.bin | Bin 12 -> 12 bytes data/tx_index.json | 16 +++++++++++++--- sequencer/src/reference_tests.rs | 23 +++++++++++++++++++++-- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/data/tx_index.bin b/data/tx_index.bin index 44a00b6448f67d3b639cb3afe406c42c4f8eef27..d94187c8350a8f0dfb3c2f8976fe871d1d436876 100644 GIT binary patch literal 12 NcmZQzU<5)40000U00RI3 literal 12 McmZQzU}S&+000&M0ssI2 diff --git a/data/tx_index.json b/data/tx_index.json index 4ab97ba604..2c0233d6f5 100644 --- a/data/tx_index.json +++ b/data/tx_index.json @@ -1,4 +1,14 @@ { - "ns_index": [0, 0, 0, 0], - "tx_index": [0, 0, 0, 0] -} + "ns_index": [ + 1, + 0, + 0, + 0 + ], + "tx_index": [ + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/sequencer/src/reference_tests.rs b/sequencer/src/reference_tests.rs index abcfbf6a3b..b85d0388b9 100644 --- a/sequencer/src/reference_tests.rs +++ b/sequencer/src/reference_tests.rs @@ -54,6 +54,20 @@ async fn reference_payload() -> Payload { .0 } +// TODO TEMPORARY: alternate reference payload with 2 transactions (not just 1). +// In the future we should modify all reference tests to use only this reference +// payload. +async fn reference_payload2() -> Payload { + Payload::from_transactions( + vec![reference_transaction(), reference_transaction2()], + &Default::default(), + &Default::default(), + ) + .await + .unwrap() + .0 +} + async fn reference_ns_table() -> NsTable { reference_payload().await.ns_table().clone() } @@ -134,11 +148,16 @@ fn reference_transaction() -> Transaction { Transaction::new(12648430.into(), payload.to_vec()) } +fn reference_transaction2() -> Transaction { + let payload: [u8; 512] = std::array::from_fn(|i| (6 * i + 7 % (u8::MAX as usize)) as u8); + Transaction::new(314159.into(), payload.to_vec()) +} + const REFERENCE_TRANSACTION_COMMITMENT: &str = "TX~jmYCutMVgguprgpZHywPwkehwXfibQx951gh4LSLmfwp"; async fn reference_tx_index() -> >::TransactionIndex { - let payload = reference_payload().await; - payload.iter(payload.ns_table()).next().unwrap() + let payload = reference_payload2().await; + payload.iter(payload.ns_table()).last().unwrap() } fn reference_test_without_committable( From 87ea487843c2c50c144ae9a52404f17ee0f6620b Mon Sep 17 00:00:00 2001 From: Gus Gutoski Date: Wed, 3 Jul 2024 12:26:58 -0400 Subject: [PATCH 3/3] new reference payload with multiple txs over multiple namespaces --- data/header.bin | Bin 804 -> 820 bytes data/header.json | 10 ++--- data/ns_table.bin | Bin 24 -> 40 bytes data/ns_table.json | 2 +- data/payload.bin | Bin 1064 -> 5260 bytes data/payload.json | 4 +- data/transaction.bin | Bin 1044 -> 276 bytes data/transaction.json | 4 +- data/tx_index.bin | Bin 12 -> 12 bytes data/tx_index.json | 4 +- sequencer/src/reference_tests.rs | 70 +++++++++++++++---------------- 11 files changed, 45 insertions(+), 49 deletions(-) diff --git a/data/header.bin b/data/header.bin index c1fa7a2dd05b02adbcdd070c7e1249b556d2d2fb..1c3990498c91566f04fbb5c1d7f3cf95581bbdf1 100644 GIT binary patch delta 265 zcmZ3&wuNnj5~Jeomo1AUH?XVt1xdcQ-sLE!9mDU+vTt|S&;4Q+H@OxlU6}05sO8)j zsIS&|UeI9D!NRJ5<;=Hp&h`FcmwGc*)HKEZgKzQ67cvYGzzn3`{Xf7U!^Xg{aKla^ z2R;UdlntzlVnik{VEj~{XqaqlZfR;^YLH}}WMXNMYG!DbWM+_-nwVl?X>Mw4VPcq; zlx&%nmX>OmXlZPjVq#&OW|(4WYMGc~m~3L|1hvMX!pOkL$Rf=&$;>#((8S!*D8<;^ zFeNz^$h0)KNHsAvFfvFpv@|m?GPJNvO*2a|HZn~z7dAF9vP?9xFtJEXmWCPy0EDwn AhX4Qo delta 249 zcmdnOwuEhi5~HG(g?aVIy}>3QtTkA8%%%6SEy)a6Wgyeh5%qM!*30j+=1+EJ)H2>R zy`myw@te!;KF5?oxwwA`96Vfhvg5HDSF`7F3AO|C7VpZl4O0v(O^ppw%uOv5(@fHgQY=#}Oj1&eQVf$5%?u6AjVvuwQd2FH zjLlLFj4jPfjFQZppvD?h7#bue8z-A58>ASdm{}$z8d@5gSR|Vp831*dCMPACSeTd_ jBv~3-7y{K9C0kk=86~C(TbLzT7^fvAS|%DvLyZCe@CQrH diff --git a/data/header.json b/data/header.json index 8868bc4356..02e7af4660 100644 --- a/data/header.json +++ b/data/header.json @@ -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": { @@ -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 } \ No newline at end of file diff --git a/data/ns_table.bin b/data/ns_table.bin index 82defd7bcf943131f0d72e98ab6d27121ba1d716..02a363d7cc1ea9225e966df338f190d33cf996c5 100644 GIT binary patch literal 40 qcmZQzU}TVCfB}UW diff --git a/data/ns_table.json b/data/ns_table.json index 6e29afa0b9..146b543fda 100644 --- a/data/ns_table.json +++ b/data/ns_table.json @@ -1,3 +1,3 @@ { - "bytes": "AQAAAO7/wAAIBAAA" + "bytes": "AwAAAO7/wAAcBgAAobC5EkAOAABksAWiXBQAAA==" } \ No newline at end of file diff --git a/data/payload.bin b/data/payload.bin index 719c44d631d7ac538afa0f4b94b1bf66c3b35a61..806d83c2a32cf935e0aade6214ddebcd88279e2f 100644 GIT binary patch literal 5260 zcmaKwRa6uXxWtzZX<52KQe^24>F!uy>7`RZI+pH~66ux>S-QIg5s>cgl+eBY@B6)T z&hLAf?|se;0DuI55Ci^K=>J`$e<1$@No(!z7RXgQ}%!6%8Cy@xWg5MWxEt z{PX2@CU)0Mm!qQB{m}5fiv9MNOQsFqRER@k>E80U{iz^~KP&pA=ugXc`G;cc?Er<@ ztZAjk)VdEr#PT8>ix-~NtO`=zp36fGg ziILQJWHwhI^h74S=B<6=G?ZJA?^xyZihpn}^vCOBLcJzleu1BT_8mdfR zR)MDocWdy5nzv`fb^;Y`pdJCW`DRWwQE=OeGf#t;kdMFnmzSN#SCjqA+q|q9Yc}4+8VT zN~pwE-_ZbaIZ?_BznB)L#}3Dp6-P|slI;UA1zwXG>|fL9v0NZSE9rO2eZW5`omSWp*`N}w-5i~j;Zv@LeXv;F zt_(^1N8v*Mri~qo-a!c5Bba@0pI&Tanez}o{K&OV%!@{C^Esz*ILE|6(uVYG-D0&uz%H z^Qdta*GDp*40|x7gLkiwmene=k53ku^Fl9RplyOT=);iG{!!(w@$%6hstCi+nk%d;lWO zWULB=cT}_(~NSl5gl{R3>6}jJV;%l1I8$-c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ZQzU}WH6VE_Y05D8*4GBLBTvaxe;a&hzU^6?7@3JHsdiit}|N=eJe%E>DzDk-a| zs;O&eYH91}>ggL88X23InweWzT3OrJ+SxleIyt+zy19FJdU^Z!`uPV01_g(NhJ{B& zMn%WO#>FQjCMBn&rln_OW@YE(=H(X@78RG2mX%jjR#n&3*3~yOHZ`}jwzYS3c6Imk z_VrJgIBD{fsne#maka3YW146>(+1BxM}m2t=qQm*tu)> zp1u3_A2@jE@R6g(j-NPr>hzhj=gwcac|p1*kc x>h+tq@7{m-`04YPuiw7^`1$MipTGY`y+0cJBRcW(fJ*~lF#x3B{XYOM9{|Tw{PF+* diff --git a/data/payload.json b/data/payload.json index 3ece05b316..2387c7aa4b 100644 --- a/data/payload.json +++ b/data/payload.json @@ -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+f4CBgoOEhYaHiImKi4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NgElGjPTH2SA9nl0ZVKM4EgQ1cvRUYwBWtFYkrfcZquK/G6+/REOOB4Q+xIIcxbsrzCI0DYsFLllEVKIfWLbdJH2WwWINsP96rBhh3aLnTeM0srC3IuZfjI+wgpXnEyMqdWJ1rqjrkMBZHvjecJmWaUhFFmBE22RGJ544P1PsMp/pVEFPGMdb+sSuqhuA88XnuYKI8ENxLXXTHE/to1mQ9khDnpntjARASxeSAFmEddAmrfSoh9JV3P49YR8QBlWAyVPt/aw==" } \ No newline at end of file diff --git a/data/transaction.bin b/data/transaction.bin index a0e15c9e94bd0b522c1ef940d4464cc122c80c56..9f086e3901eb0f4a9389665931f446fd213ae339 100644 GIT binary patch literal 276 zcmV+v0qgz%0098*|G)qM000000RR910002KKOD+qRKk?cWWbo-qAdgfo|L!S`)l-W zcsqVi)ZMBCe53d2$5nz-1B@9Y+&)96KVxLLEru^Oe#}A|hkLlh^5a8UQDl1d$uJ+- z9qY72&!(%`uTHsB@F;D?-B>;EbjYs)lRtW8V}kDL6}l2#fPp@0_Nt(no!7#0DQ8(< zYyt`F*eB@}Q(Rjb`a4T+NGM$-EdaB6^%2~j+3I_GwgQbdWjt1r%0+)ckAUk!Rvy1K z$L%Ha`w#pBG+(=!J|785`;R=5cS;=m6GgNPe2Q?ACnig*;E{$oA_dN>wl-iVoP!-a`WannuZvh}A-WN_>_8 literal 1044 zcmZQzU}Sjr{{RCRus|pVMkZz!RyKAHPA+a9UOs*SK_OugQ894|NhxU=Svh$HMI~hw zRW)@DO)YI5T|IpRLnC7oQ!{f5ODk&|TRVFPM<-_&S2uSLPcLsDUqAnVz@Xre(6I1` z$f)R;*tqzF#H8eu)U@=B%&hF3+`RmP!lL4m(z5c3%Bt#`+PeCN#-`?$*0%PJ&aUpB z-oE|`6DLicGIiSY88c_io-=pe`~?daEnc#8+42=DSFK*NcHR078#ise?%vK0M6+A%m4rY diff --git a/data/transaction.json b/data/transaction.json index 5ca56e3e37..df1071171d 100644 --- a/data/transaction.json +++ b/data/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QoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+AAECAw==" -} + "payload": "vj8cymNUwpTPZMCY3qItBACelLfb+2v0bng7fk/U3aoEfKP36cdVglIDjBkk3D5Dpz9jZLgthi81fsxCGod7uMTy40NZUWR69skwH9gd67REz6ar2K9OuVPwKG3F3Vg973TIrwKTP3plY4Lu6hW6El2AgT5q9qqgmZ3XwnIpZ1lfbAIJ7Ngn6RRTXFsa+jtLb0goXSQtALN69RHcntnqe3q2Ao02ZTxWkspFf0GPgOtCVh6/NcftJfP7D/wDNF+7mT4fCUn7jzySd0oc/BNFtAx8inCSJyZLrOCRhjkiBd8VNjrWUx9mA76WZpIRSlUwIooO2MzeQwL/mkbJjojVQg==" +} \ No newline at end of file diff --git a/data/tx_index.bin b/data/tx_index.bin index d94187c8350a8f0dfb3c2f8976fe871d1d436876..efdcb0dd86702248c14b373f0fe39728c92a6005 100644 GIT binary patch literal 12 RcmZQzU}RuoU|?VcVgLX-00{s9 literal 12 NcmZQzU<5)40000U00RI3 diff --git a/data/tx_index.json b/data/tx_index.json index 2c0233d6f5..0c24f617f1 100644 --- a/data/tx_index.json +++ b/data/tx_index.json @@ -1,12 +1,12 @@ { "ns_index": [ - 1, + 2, 0, 0, 0 ], "tx_index": [ - 0, + 5, 0, 0, 0 diff --git a/sequencer/src/reference_tests.rs b/sequencer/src/reference_tests.rs index b85d0388b9..0bc43bb0ba 100644 --- a/sequencer/src/reference_tests.rs +++ b/sequencer/src/reference_tests.rs @@ -22,8 +22,8 @@ //! test. use crate::{ - block::NsTable, state::FeeInfo, ChainConfig, FeeAccount, Header, L1BlockInfo, Payload, - SeqTypes, 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; @@ -34,6 +34,7 @@ use hotshot_types::traits::{ }; 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; @@ -44,35 +45,31 @@ use vbs::BinarySerializer; type Serializer = vbs::Serializer; async fn reference_payload() -> Payload { - Payload::from_transactions( - vec![reference_transaction()], - &Default::default(), - &Default::default(), - ) - .await - .unwrap() - .0 -} - -// TODO TEMPORARY: alternate reference payload with 2 transactions (not just 1). -// In the future we should modify all reference tests to use only this reference -// payload. -async fn reference_payload2() -> Payload { - Payload::from_transactions( - vec![reference_transaction(), reference_transaction2()], - &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 { @@ -141,22 +138,21 @@ 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(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) } -fn reference_transaction2() -> Transaction { - let payload: [u8; 512] = std::array::from_fn(|i| (6 * i + 7 % (u8::MAX as usize)) as u8); - Transaction::new(314159.into(), payload.to_vec()) -} - -const REFERENCE_TRANSACTION_COMMITMENT: &str = "TX~jmYCutMVgguprgpZHywPwkehwXfibQx951gh4LSLmfwp"; +const REFERENCE_TRANSACTION_COMMITMENT: &str = "TX~EikfLslj3g6sIWRZYpN6ZuU1gadN77AHXmRA56yNnPrQ"; async fn reference_tx_index() -> >::TransactionIndex { - let payload = reference_payload2().await; + let payload = reference_payload().await; payload.iter(payload.ns_table()).last().unwrap() } @@ -335,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, ); }