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

Fuzzing tests for ledger rpc #403

Merged
merged 55 commits into from
Jul 3, 2023
Merged

Fuzzing tests for ledger rpc #403

merged 55 commits into from
Jul 3, 2023

Conversation

theochap
Copy link
Contributor

@theochap theochap commented Jun 9, 2023

Description

This PR implements fuzzing tests for ledger rpc. The fuzzing api is used to generate random test data for the ledger db and random queries to test the ledger rpc api.

Linked Issues

Testing

Some tests have been added to the test_rpc.rs folder.

@codecov
Copy link

codecov bot commented Jun 9, 2023

Codecov Report

Merging #403 (d2cd0bf) into main (758bb4e) will increase coverage by 1.0%.
The diff coverage is 72.6%.

❗ Current head d2cd0bf differs from pull request most recent head 729f4f0. Consider uploading reports for the commit 729f4f0 to get more accurate results

Impacted Files Coverage Δ
full-node/db/sov-db/src/schema/types.rs 79.3% <ø> (+3.4%) ⬆️
rollup-interface/src/node/db/mod.rs 0.0% <ø> (-15.0%) ⬇️
...nterface/src/state_machine/crypto/simple_merkle.rs 0.0% <0.0%> (ø)
rollup-interface/src/state_machine/mocks.rs 61.9% <0.0%> (ø)
rollup-interface/src/state_machine/stf/fuzzing.rs 66.3% <66.3%> (ø)
full-node/db/sov-db/src/ledger_db/mod.rs 91.2% <85.7%> (+0.1%) ⬆️
full-node/db/sov-db/src/schema/tables.rs 85.0% <97.4%> (+37.7%) ⬆️
full-node/db/sov-schema-db/src/iterator_test.rs 97.6% <100.0%> (+<0.1%) ⬆️
rollup-interface/src/state_machine/stf.rs 80.0% <100.0%> (+18.4%) ⬆️

... and 25 files with indirect coverage changes

@theochap theochap marked this pull request as ready for review June 14, 2023 13:23
citizen-stig and others added 4 commits June 28, 2023 16:57
* fix(sov-db): serialize u64 keys as big-endian

* style(sov-db): formatting fix

* test(demo-rollup): proptest regressions

* test(demo-rollup): larger batches, json utils

* fix(sov-db): serialize SlotByNumber, EventByNumber as big-endian

The big-endian fix for u64_wrapper! wasn't applied to all relevant types. I've
made the following changes:

* Renamed define_table_with_u64_wrapper_keys -> define_table_with_seek_key_codec
  to not be u64_wrapper! -specific.
* I replaced the u64_wrapper! specific logic inside said macro to use
* big-endian bincode instead, in preparation for using it for different and
  more complex types. Not yet used for anything other than u64_wrapper!.
* I removed the blanked implementation of SeekKeyEncoder for all KeyEncoder's,
  so that implementors have to opt-in, providing a fail-safe.

In the future we'll explore better type safety mechanisms.

* Update define_table_with_seek_key_codec macro comment
full-node/db/sov-db/src/ledger_db/mod.rs Outdated Show resolved Hide resolved
@neysofu neysofu merged commit db09c03 into main Jul 3, 2023
@neysofu neysofu deleted the theo/tests-rpc branch July 3, 2023 15:00
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

Successfully merging this pull request may close these issues.

Add proptest for ledger RPC
5 participants