From 4147f856dc8329e367b8f870366751799aa39866 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Fri, 31 Aug 2018 16:10:41 +0400 Subject: [PATCH] update arch doc --- docs/architecture/adr-020-block-size.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/architecture/adr-020-block-size.md b/docs/architecture/adr-020-block-size.md index d40766b52..aebf3069c 100644 --- a/docs/architecture/adr-020-block-size.md +++ b/docs/architecture/adr-020-block-size.md @@ -5,7 +5,8 @@ 13-08-2018: Initial Draft 15-08-2018: Second version after Dev's comments 28-08-2018: Third version after Ethan's comments -30-08-2018: AminoOverheadForBlock => MaxAminoOverheadForBlock, added MaxAminoOverheadForTx +30-08-2018: AminoOverheadForBlock => MaxAminoOverheadForBlock +31-08-2018: Bounding evidence and chain ID ## Context @@ -44,12 +45,16 @@ are constants defined inside the `types` package: - MaxEvidenceBytes - 364 bytes - MaxHeaderBytes - 476 bytes (~276 bytes hashes + 200 bytes - 50 UTF-8 encoded symbols of chain ID 4 bytes each in the worst case + amino overhead) -- MaxAminoOverheadForBlock - 4 bytes (assuming MaxHeaderBytes includes amino +- MaxAminoOverheadForBlock - 8 bytes (assuming MaxHeaderBytes includes amino overhead for encoding header, MaxVoteBytes - for encoding vote, etc.) +ChainID needs to bound to 50 symbols max. + +When reaping evidence, we use MaxBytes to calculate the upper bound (e.g. 1/10) +to save some space for transactions. + NOTE while reaping the `max int` bytes in mempool, we should account that every transaction will take `len(tx)+aminoOverhead`, where aminoOverhead=1-4 bytes. -Therefore, MaxAminoOverheadForTx should be added. We should write a test that fails if the underlying structs got changed, but MaxXXX stayed the same.