planetarium / libplanet

Blockchain in C#/.NET for on-chain, decentralized gaming
https://docs.libplanet.io/
GNU Lesser General Public License v2.1
506 stars 142 forks source link

Limit size of block (byte-wise) #201

Closed longfin closed 3 years ago

longfin commented 5 years ago

Currently, Libplanet doesn't define how many transactions will be stored in a block, and the size of a transaction is also not explicitly defined. however, in order to predict figures such as storage space and network traffic, it is necessary to be able to determine how much physical space a block occupies.

The block size is not a protocol-level constraint, and game developers need to adjust the unit to synchronize the status of each game, so I suggest offering it as an configurable parameter.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

longfin commented 4 years ago

Block size can be defined in two ways.

  1. total bytes
  2. a count of transactions.

In many other blockchain projects, they prefer to limit by byte size. it's useful to predict disk space, network traffic, and discovering attack scenarios. but limiting by a count of transactions can be also useful because it can affect the performance of executing blocks directly. (and it can be more straightforward for game devs)

So, it would be useful if we add parameters like as TotalBlockSize and TotalTxCount to BlockPolicy and restrict block using them.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

dahlia commented 3 years ago

I'm going to work on this.