logos-co / nomos-node

Nomos blockchain node
49 stars 18 forks source link

Basic Cryptarchia fuzz test #628

Closed youngjoon-lee closed 6 months ago

youngjoon-lee commented 6 months ago

This contains a basic fuzz test for Cryptarchia. This doesn't cover all possible cases. Also, this doesn't check post-conditions deeply, such as fork selection. This only checks if block headers are accepted and added to the chain without any error in some cases. Before we proceed further, I'd like to draw a line here and move on.

NOTE: Unlike Carnot fuzz, I added Cryptarchia fuzz test under the /tests because the entire Cryptarchia is split into multiple crates (engine, ledger, and core). At the beginning, I tried to write fuzz tests for each crate but end up thinking it's not beneficial than I thought.

P.S. I'm been thinking about which post-conditions we can add without replicating too much logic from the original code to the test code. It's not simple than I expected. We may not really need to have post-condition checks. I'll think about it.

youngjoon-lee commented 6 months ago

I'll reopen this as a new PR. I came up with a simple and better idea.