Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partially deprecate PoW Block handling #3790

Open
3 tasks
greymistcube opened this issue May 17, 2024 · 2 comments
Open
3 tasks

Partially deprecate PoW Block handling #3790

greymistcube opened this issue May 17, 2024 · 2 comments

Comments

@greymistcube
Copy link
Contributor

greymistcube commented May 17, 2024

There is no real code path that is actually taken within IActionEvaluator for past PoW Blocks.

  • In lib9c and above, evaluate calls are dispatched to other binaries, so it is not in use for production.
  • Within libplanet, as there is no real way to create a valid PoW Block, the unit tests can't be really considered proper.

That is, we are dragging along what is essentially a dead piece of code more for show (and our own emotional comfort) but not for real substance. However, the following two functionalities must be kept.

  • To be able to "read" PoW Blocks.
    • The word read is in quotations as reading of a PoW Block bypasses numerous validations and the said Block is not read in full (because Difficulty related properties are discarded).1
  • To be able to evaluate said PoW Blocks in lib9c and above.

In order to do so,

  • Disable the native implementation of IActionEvaluator, i.e. ActionEvaluator, to be able to evaluate a PoW Block.
  • Disable Append() for a PoW Block.
  • Add tests codes regarding reading of PoW Blocks.

Footnotes

  1. Note that write is not part of the spec, as this is no longer possible.

@riemannulus
Copy link
Member

To be able to "read" PoW Blocks.

In post-sloth, IMO, we don't need able to read old PoW blocks.
After sloth, we can easily cut out the block's height and It does not make lower chain security.
So, instead of being able to read PoW blocks, how about a re-genesis on the NineChronicles and drop out old blocks?

@greymistcube
Copy link
Contributor Author

greymistcube commented May 20, 2024

Several things:

  • As far as I am concerned, forking the chain with a new genesis block of index zero is possible with or without the sloth update. The sloth update only makes it somewhat easier. Besides, whether and when it may be done is still only under discussion.
  • This is only a partial safety measure to ensure that re-evaluation of a past block is possible (although I'm not certain if this is working as intended currently for 9c).
  • Additionally, the current API is tied too much to past Blocks (and evaluations) and this is making a refactoring of API nearly impossible.
  • Besides, additional tests in 🔧 Added tests for unmarsahling PoW blocks #3791 should have been added when moving to PBFT in the first place. 🙄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants