From b9f5be17b0ff27947f9e4fa3e5b234aa9d39e39a Mon Sep 17 00:00:00 2001 From: jowparks Date: Mon, 8 Apr 2024 23:32:45 -0400 Subject: [PATCH] buffer as data encoding (#77) --- src/cache/index.test.slow.ts | 2 +- src/cache/index.test.ts | 20 +++--- src/cache/index.ts | 66 +++++++++++-------- src/controllers/block.ts | 6 +- src/upload/index.test.ts | 2 +- src/upload/index.ts | 2 +- test/dbfixture/cache/leveldb/000003.log | Bin 7943 -> 0 bytes test/dbfixture/cache/leveldb/000007.ldb | Bin 0 -> 6076 bytes test/dbfixture/cache/leveldb/000008.log | 0 test/dbfixture/cache/leveldb/CURRENT | 2 +- test/dbfixture/cache/leveldb/LOG | 6 +- test/dbfixture/cache/leveldb/LOG.old | 3 + test/dbfixture/cache/leveldb/MANIFEST-000002 | Bin 50 -> 0 bytes test/dbfixture/cache/leveldb/MANIFEST-000006 | Bin 0 -> 149 bytes 14 files changed, 63 insertions(+), 46 deletions(-) delete mode 100644 test/dbfixture/cache/leveldb/000003.log create mode 100644 test/dbfixture/cache/leveldb/000007.ldb create mode 100644 test/dbfixture/cache/leveldb/000008.log create mode 100644 test/dbfixture/cache/leveldb/LOG.old delete mode 100644 test/dbfixture/cache/leveldb/MANIFEST-000002 create mode 100644 test/dbfixture/cache/leveldb/MANIFEST-000006 diff --git a/src/cache/index.test.slow.ts b/src/cache/index.test.slow.ts index 99c4184..20443e1 100644 --- a/src/cache/index.test.slow.ts +++ b/src/cache/index.test.slow.ts @@ -14,7 +14,7 @@ describe("LightBlockCache creating cache", () => { const cacheBlocks = lightBlockCache.cacheBlocks(); await Promise.race([cacheBlocks, delay()]); const head = await lightBlockCache.getHead(); - const block = await lightBlockCache.getBlockByHash(head!.toString("hex")); + const block = await lightBlockCache.getLightBlock(head!); expect(block).toHaveProperty("protoVersion"); expect(block).toHaveProperty("sequence"); expect(block).toHaveProperty("hash"); diff --git a/src/cache/index.test.ts b/src/cache/index.test.ts index 9e63434..70cfc81 100644 --- a/src/cache/index.test.ts +++ b/src/cache/index.test.ts @@ -1,10 +1,7 @@ -import { LightBlock } from "../models/lightstreamer"; import { blockFixture } from "../../test/fixtures"; import { lightBlockCache } from "."; describe("LightBlockCache", () => { - const fakeHash = "hash1"; - beforeAll(async () => { await lightBlockCache.open(); }); @@ -14,24 +11,25 @@ describe("LightBlockCache", () => { }); it("storing and retrieving block is successful", async () => { - const encoded = LightBlock.encode(blockFixture).finish(); - await lightBlockCache.put(fakeHash, encoded); - await lightBlockCache.put(blockFixture.sequence.toString(), fakeHash); + await lightBlockCache.putLightBlock(blockFixture); - const hashBlock = await lightBlockCache.getBlockByHash(fakeHash); + const hashBlock = await lightBlockCache.getLightBlock(blockFixture.hash); expect(hashBlock).toEqual(blockFixture); - const sequenceBlock = await lightBlockCache.getBlockBySequence( + const sequenceBlock = await lightBlockCache.getLightBlockBySequence( blockFixture.sequence, ); expect(sequenceBlock).toEqual(blockFixture); }); it("storing and retrieving hash is successful", async () => { - await lightBlockCache.put("head", Buffer.from("deedbeef", "hex")); + await lightBlockCache.putHead(Buffer.from("deadbeef", "hex"), 1000); + + const head = await lightBlockCache.getHead(); + expect(head?.toString("hex")).toEqual("deadbeef"); - const block = await lightBlockCache.getHead(); - expect(block!.toString("hex")).toEqual("deedbeef"); + const sequence = await lightBlockCache.getHeadSequence(); + expect(sequence).toEqual(1000); }); it("finality sequence is always behind head sequence by specified amount", async () => { diff --git a/src/cache/index.ts b/src/cache/index.ts index b57230f..e6fb975 100644 --- a/src/cache/index.ts +++ b/src/cache/index.ts @@ -83,31 +83,29 @@ export class LightBlockCache { } else if (content.type === "disconnected") { logger.warn(`Removing block ${content.block.sequence}...`); const block = lightBlock(content); - await this.db.put("head", block.previousBlockHash); - await this.db.put("headSequence", (block.sequence - 1).toString()); - await this.db.del(block.sequence); - await this.db.del(block.hash); + await this.putHead(block.previousBlockHash, block.sequence - 1); + await this.del(block.sequence.toString()); + await this.del(block.hash.toString("hex")); } } } } private async rollbackHead(): Promise { - let head = (await this.getHeadSequence()) - 1; - if (!head) { + let headSequence = (await this.getHeadSequence()) - 1; + if (!headSequence) { logger.error("Head sequence is not set. Cannot rollback."); return; } let block = null; while (!block) { - block = await this.getBlockBySequence(head); + block = await this.getLightBlockBySequence(headSequence); if (!block) { - head -= 1; + headSequence -= 1; } } - await this.db.put("headSequence", head.toString()); - await this.db.put("head", block.hash); - logger.info(`Rolled back head to block sequence ${head}`); + await this.putHead(block.hash, headSequence); + logger.info(`Rolled back head to block sequence ${headSequence}`); } async cacheBlock(block: LightBlock): Promise { @@ -118,14 +116,12 @@ export class LightBlockCache { ); } const hash = block.hash; - await this.db.put(hash, LightBlock.encode(block).finish()); - await this.db.put(block.sequence.toString(), hash); + await this.putLightBlock(block); const finalizedSequence = await this.getFinalizedBlockSequence(); if (block.sequence - this.finalityBlockCount > finalizedSequence) { this.putFinalizedBlockSequence(block.sequence - this.finalityBlockCount); } - await this.db.put("head", hash); - await this.db.put("headSequence", block.sequence.toString()); + await this.putHead(hash, block.sequence); } async getFinalizedBlockSequence(): Promise { @@ -135,23 +131,32 @@ export class LightBlockCache { : this.finalityBlockCount + 1; } - async getHead(): Promise { - const head = await this.get("head"); - return head ? Buffer.from(head) : null; + async putFinalizedBlockSequence(sequence: number): Promise { + await this.put("finalizedBlockSequence", Buffer.from(sequence.toString())); } - async putFinalizedBlockSequence(sequence: number): Promise { - await this.db.put("finalizedBlockSequence", sequence.toString()); + async putHead(hash: Buffer, sequence: number): Promise { + await this.put("head", hash); + await this.put("headSequence", Buffer.from(sequence.toString())); } - async getBlockByHash(hash: string): Promise { - const block = await this.get(hash); - return block ? LightBlock.decode(block) : null; + async getLightBlock(hash: Buffer): Promise { + try { + const data = await this.get(hash.toString("hex")); + if (!data) return null; + return LightBlock.decode(data); + } catch (e) { + return null; + } } - async getBlockBySequence(sequence: number): Promise { + async getLightBlockBySequence(sequence: number): Promise { const hash = await this.get(sequence.toString()); - return hash ? await this.getBlockByHash(hash.toString()) : null; + return hash ? await this.getLightBlock(hash) : null; + } + + async getHead(): Promise { + return this.get("head"); } async getHeadSequence(): Promise { @@ -160,7 +165,7 @@ export class LightBlockCache { return Number(head.toString()); } - async get(key: string): Promise { + async get(key: string): Promise { try { const data = await this.db.get(key); return data; @@ -169,10 +174,17 @@ export class LightBlockCache { } } - async put(key: string, value: Uint8Array | string): Promise { + private async put(key: string, value: Buffer): Promise { await this.db.put(key, value); } + async putLightBlock(block: LightBlock): Promise { + const key = block.hash.toString("hex"); + const value = LightBlock.encode(block).finish(); + await this.put(block.sequence.toString(), block.hash); + await this.put(key, Buffer.from(value)); + } + async del(key: string): Promise { await this.db.del(key); } diff --git a/src/controllers/block.ts b/src/controllers/block.ts index 9c0bb68..1444f42 100644 --- a/src/controllers/block.ts +++ b/src/controllers/block.ts @@ -75,9 +75,9 @@ export class BlockController { let block = null; if (hash) { - block = await lightBlockCache.getBlockByHash(String(hash)); + block = await lightBlockCache.getLightBlock(Buffer.from(hash, "hex")); } else if (sequence) { - block = await lightBlockCache.getBlockBySequence(Number(sequence)); + block = await lightBlockCache.getLightBlockBySequence(Number(sequence)); } if (block) { @@ -127,7 +127,7 @@ export class BlockController { // Placeholder logic: Fetch blocks from cache or database const blocks: LightBlock[] = []; for (let i = start; i <= end; i++) { - const block = await lightBlockCache.getBlockBySequence(i); + const block = await lightBlockCache.getLightBlockBySequence(i); if (block) { blocks.push(block); } diff --git a/src/upload/index.test.ts b/src/upload/index.test.ts index 5829b8c..a2e302f 100644 --- a/src/upload/index.test.ts +++ b/src/upload/index.test.ts @@ -22,7 +22,7 @@ describe("LightBlockUpload", () => { it("should gzip blocks/manifest, last block should match", async () => { const tempFile = path.join(os.tmpdir(), "test"); - const firstBlock = (await lightBlockCache.getBlockBySequence( + const firstBlock = (await lightBlockCache.getLightBlockBySequence( 1, )) as LightBlock; const triggerUploadTime = diff --git a/src/upload/index.ts b/src/upload/index.ts index 3c89935..e483893 100644 --- a/src/upload/index.ts +++ b/src/upload/index.ts @@ -166,7 +166,7 @@ export class LightBlockUpload { // eslint-disable-next-line no-constant-condition while (true) { - const block = await this.cache.getBlockBySequence(currentSequence); + const block = await this.cache.getLightBlockBySequence(currentSequence); const finalizedSequence = await this.cache.getFinalizedBlockSequence(); if (!block || block.sequence > finalizedSequence) { const currentTimestamp = Date.now(); diff --git a/test/dbfixture/cache/leveldb/000003.log b/test/dbfixture/cache/leveldb/000003.log deleted file mode 100644 index cd87912367f17cc6b740d7ab9b9ffc1c2e3590b4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7943 zcmb{1c{Ei2{|9hmFla>9kUb?!&D@!}GuJM%d{mO9DAlZyrLso$?9zfn+4nVDibS@A zEXke}WhqP9i&DRl&$r+F^XqqhKiz-sIdji>&imYX+~;}C`%=OVc}lawU`!jw`WdE) zhaiXy5>O-(1&yOXL<$LyfdDFs4B&})GLcBeQ*jVTq2h2Lii{>uArJ%NC@2~QB%rY< zD&{2zJB$Y=BIzF2=v&!ob!X5ia=6aJGxyn8%p0>awbx=mEAC!D&G*uh|9Phklj!uPp^T_4|7n|o4T?U50Wy(#M<;9s$FVk;|T?W)W_NSDl_%$agw^t~+?&czT zRa|2$_RF_N#(tjT0S4ymBO7}Zd%5xotsMw=a{24rhq^%Jb@cjQX!=&Nr2n(VQ(5g(z*tJOZlHVe+Ij7*l+gXSd;`bx4wAYyPS%nR=bfpN zR0p!7`vqqk`iJ&54pc`;TdF(i|8fBH%k3a+g-KHsHNCr}9naSN#e*sA7~)^61Qy9sZU~W}*pF zGEoWea`9u9QejcfSj)Z_I=ig7cV!_XshRc@Eb7^wIjdhbevjX~ zbdQR#7Dr)R12hEwEKg+9d)X2>J<=Rk>lh6_^OL$gUAvRnV&C1l!Sg9ic|u7Ib=OW? z0v>F<4=a-o%W~yNE%NR$2rq^=Wk0Y}s`7ox& z?b$)d*!{VoQzbmxI@PwbO~P)71W}tkDnhO7_j?{4qHTj66_oUp$mu4?EX2y~bEHPhzP*?CeVp5Ja^r`Q(t7#vtct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CAsbu<|2ED665{5#@Od`@RlF2k2grVTc zcmj_8t_4FxQ?S1*bN=e(q@Fm*-DS-1iD{4ad$wx8mQ?1}rKrAVffesly4NlLS-V_T z>cW5amwyO|YvxTB$HkT{Z;juxD$aL*S2x;9*m}^in zp3AD-`|07pp{aY@CPSEmh0nbl&jHqk-L~$y@}W1j4ep)eRlG_e@KmvyhdNQ~&ej`e zAGo-6!Y3!*6qg~$ttN14ZnQtBCO7%b4X=}-2Vg#B>8HuAa)n`14Mtb;Vc{nNu&2r* zf(CkzZ4V349@6sa+IB;QC)WSiS=(~2v=1@ET?s55f88=Nr>!d4m( Uc2;FNW^u+`2FzIK|LyL-05I!;`Tzg` diff --git a/test/dbfixture/cache/leveldb/000007.ldb b/test/dbfixture/cache/leveldb/000007.ldb new file mode 100644 index 0000000000000000000000000000000000000000..6862047e1bd4970adc54d31359ff5bd156111474 GIT binary patch literal 6076 zcmbtYc~p&E+rRH~PMyvWr!*<)R7$fm4;qxx@Pwp+B9AjF4QN!FB@ItBNukm_YamLb z2}uK*qZBF{XeOlZuIE|r_s6$h-}|j^ulrutZ|{BWYprvB_ciT2JPt5zf)hY+MvurL zvpEDBlf)p=I7}9aMkR7-JSvC8By%VnGKoN9bID{Phr#0zX(TF@!6Z_M1U{KVAcI>0 z0E8`E2ZcZ!N*WJM8XpM8hq_!-w(J>gNN8%rt9KHcrzDgP#~EzYfh#~7h-AH6b_)&7wd zil%B?aS2U<+fpsvn#R?h!_dvJ0ShSvGvoXNzX(t4SBsUf4~CzX&fUDhZnM0qG;b(bvmB;0Maug7Whd(q^jPI`gVcdVRK)25Y=@Qlyr@g!8qKSP( zFI_LAz=pv(S-r%1dD-(>-srGr-m9;5Y#ExMtfvehNXVEM8 zXIiaz&35T#3Q-_?dE2h^>`Q4cVhk&;vpx%0s(z>PD2AASc%nJBKkAit z&%?mlx#BY(J7e*wWlG#DJHYY5EouX1>UN>YyKC}WqoR$apm!klgI4hxqFUT zJ393pHFvJPXf{&T&wGNcQ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3!%8kJZK`V8_{~iTWU&Pi{ h_d_pi4LlJPGXJPaNYy&IHv9cJ^dmTWo0rM!{{lT(-+}-D literal 0 HcmV?d00001 diff --git a/test/dbfixture/cache/leveldb/000008.log b/test/dbfixture/cache/leveldb/000008.log new file mode 100644 index 0000000..e69de29 diff --git a/test/dbfixture/cache/leveldb/CURRENT b/test/dbfixture/cache/leveldb/CURRENT index 1a84852..f7753e2 100644 --- a/test/dbfixture/cache/leveldb/CURRENT +++ b/test/dbfixture/cache/leveldb/CURRENT @@ -1 +1 @@ -MANIFEST-000002 +MANIFEST-000006 diff --git a/test/dbfixture/cache/leveldb/LOG b/test/dbfixture/cache/leveldb/LOG index 0329f29..234dfd5 100644 --- a/test/dbfixture/cache/leveldb/LOG +++ b/test/dbfixture/cache/leveldb/LOG @@ -1 +1,5 @@ -2024/03/29-16:12:39.733354 170903000 Delete type=3 #1 +2024/04/08-20:26:12.744956 17269f000 Recovering log #5 +2024/04/08-20:26:12.745468 17269f000 Level-0 table #7: started +2024/04/08-20:26:12.745659 17269f000 Level-0 table #7: 6076 bytes OK +2024/04/08-20:26:12.746007 17269f000 Delete type=0 #5 +2024/04/08-20:26:12.746084 17269f000 Delete type=3 #4 diff --git a/test/dbfixture/cache/leveldb/LOG.old b/test/dbfixture/cache/leveldb/LOG.old new file mode 100644 index 0000000..4e06b12 --- /dev/null +++ b/test/dbfixture/cache/leveldb/LOG.old @@ -0,0 +1,3 @@ +2024/04/08-20:25:05.384949 178807000 Recovering log #3 +2024/04/08-20:25:05.385875 178807000 Delete type=0 #3 +2024/04/08-20:25:05.385905 178807000 Delete type=3 #2 diff --git a/test/dbfixture/cache/leveldb/MANIFEST-000002 b/test/dbfixture/cache/leveldb/MANIFEST-000002 deleted file mode 100644 index bbbc585686bcbcc33686059c69d80b7b4e1291cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 50 zcmWIhx#Ncn10$nUPHI_dPD+xVQ)NkNd1i5{bAE0?Vo_pAe$kRS-TOEg7@3$k8JJmE F7y#sj5K{mE diff --git a/test/dbfixture/cache/leveldb/MANIFEST-000006 b/test/dbfixture/cache/leveldb/MANIFEST-000006 new file mode 100644 index 0000000000000000000000000000000000000000..2736b68a5198f40d1a8f995c7f3f583080861874 GIT binary patch literal 149 zcmWIhx#Ncn10$nUPHI_dPD+xVQ)NkNd1i5{bAE0?Vo_pAe$iPgh9}t!j7%Jy49uJ? zI_wPWd-OdFK)^8BI4Rk{%+koh$Sm11(a6lyFvTp@G}*|~IN2oG*vP;rDaF{>FxetC q+0e|$)YQV#(8SOn%{bY>m{E=a3`8Q literal 0 HcmV?d00001