excelsia / vee

VEE Reference Full Node
MIT No Attribution
29 stars 10 forks source link

storage size #37

Open ncying opened 6 years ago

ncying commented 6 years ago

Test Net: SanMateo Block number: ~40000 Blockchain size: ~330MB State size: ~60MB

~ 10KB per block (only one minting transaction per block)

virtualeconomy commented 6 years ago

why is each block so big? how many transactions does each block contain?

the state size seems more reasonable.

ncying commented 6 years ago

shenzhen team use SanMateo to test their wallet, maybe some transfer transactions. but < 2 transactions per block (1 minting tx)

virtualeconomy commented 6 years ago

then I don't understand why the block size is 10KB.

ncying commented 6 years ago

update: Test Net : Worcester (34.224.6.187) Block number: 69267 blockchain.dat : 377.7MB state.dat : 245.8kB

~ 5KB per block (no minting transaction in each block)

blocksize: Worcester: "blocksize" = 218 SanMateo: "blocksize" = 388

pkubear commented 6 years ago

so far , there are two miners to run, and each produces one block per 25 seconds. if one block size is max 1M, so one day's storage useage is 6912M, it it too crazy! if one block is 5KB, so one day's storage usage is 34.56M

ncying commented 6 years ago

https://github.com/excelsia/VEE/blob/master/src/main/scala/com/wavesplatform/history/HistoryWriterImpl.scala blockchain.dat includes 4 MVStore maps

      val h = height() + 1
      val score = (if (height() == 0) BigInt(0) else this.score()) + block.blockScore
      blockBodyByHeight.mutate(_.put(h, block.bytes))
      scoreByHeight.mutate(_.put(h, score))
      blockIdByHeight.mutate(_.put(h, block.uniqueId))
      heightByBlockId.mutate(_.put(block.uniqueId, h))
      db.commit()
ncying commented 6 years ago

update: test base on https://github.com/excelsia/VEE/pull/41

height: 1035 blockchain.dat : 1.8 MB (1,822,720 bytes) state.dat : 565.2 kB (565,248 bytes)

height: 2048 blockchain.dat : 3.7 MB (3,723,264 bytes) state.dat : 1.3 MB (1,286,144 bytes)

height: 3064 blockchain.dat : 5.3 MB (5,312,512 bytes) state.dat : 1.6 MB (1,617,920 bytes)

height: 5060 blockchain.dat : 6.5 MB (6,451,200 bytes) state.dat : 3.2 MB (3,235,840 bytes)

only one minting transaction per block, no extra transaction "blocksize" = 440