Rewriting my toy blockchain in Rust
ezzeriesa.notion.site
ezzeriesa.notion.site
Random plug - Bradfield CSI applications are open, highly recommend. https://bradfieldcs.com/csi
Another easy speed up would be using an intrinsic [0] to count leading zeroes which would just call the lzcnt instruction [1] (or equivalent) and skip the need for a loop for difficulty <=64.
[0]: https://doc.rust-lang.org/std/primitive.u32.html#method.lead...
(Joke, by the way. Although something that can happen if you're not careful).
First time I tried to load it I got an error, but I'm sure I'll be able to view it sooner or later. Can confirm Notion is not great.
Are block explorers prepared to show non-solidity code if the dev made the info available?
Well, obviously it is distributed, so you want Partition Tolerance.
Well, obviously it is financial, so you need Consistency.
Well, obviously you always want to be able to use it so you need Availability.
But you can only pick two...
Consistency is more akin to an eventual consistency model. There may be two blocks found at the same time that are sent out to the network. At some point, nodes which accepted the minority block will re-org and become consistent with the rest of the network.
Re-orgs are why you wait for X confirmations before trusting that a transaction is finalized.