libplanet
libplanet copied to clipboard
Provide a sensible way to inject `IBlockPolicy<T>` to `Agent`
Using Planet Clicker as a reference, if we were to provide a simpler interface such as LibplanetUnity.Agent, additional options should be easily accessible by game developers. I would assume game developers would be most interested in providing their own BlockPolicy.BlockAction and BlockPolicy.BlockInterval. 😗
Proper updatable policy API design is no easy task, as its current implementation is quite convoluted in order to accommodate NineChronicles chain. If we do not want to revisit the pitfalls of Lib9c, we should tread carefully.
Some thoughts:
- There is some discrepancy between what is fixed and what isn't.
- Variable
HashAlgorithmTypewas introduced in order to allow different hashing algorithms. - Variable
MaxBlockByteswas introduced to bypass block size limit. - Variable
MinTransactionsPerBlockwas introduced to prevent selfish mining. - Variable
MaxTransactionsPerBlockwas introduced due to TPS tuning when the network was unstable. - Variable
MaxTransactionsPerSignerPerBlockwas introduced to defend againstTransaciton<T>spamming.
- Variable
- On top of these, there are ad hoc policies in Lib9c such as
AuthorizedMinersPolicy, etc. adding a substantial amount of constraint on allowingBlockPolicyto be more fluid. - However, variable
BlockActionandBlockIntervalare not implemented, even though these might be most useful. 🙄
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.