-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enforce namespace table validity at consensus (#1607)
* new method NsTable::validate, use it in state::validate_proposal * serde deserialize check NsTable::validate via ugly boilerplate serde-rs/serde#1220 (comment) * add test for invalid byte lengths * rename and tidy doc * Payload::from_transactions use BTreeMap instead of HashMap * NsIter do not skip duplicate entries * NsTable::validate enforce increasing entries, with tests * NsTable::validate enforce correct header, with tests * NsTable::validate disallow 0 namespace id, offset * tweak doc * clippy pacification game with old rust version * more clippy pacification (someone plz update nix) * debug CI * debug-ci: revert BTreeMap to HashMap * debug ci: remove serde validation, restore BTreeMap * restore NsTable serde validation * NsTable::validate tests also check serde round trip * NsTable do not derive Default, fix test_append_and_collect_garbage * restore ns_table.validate() * NamespaceId do not derive Default, Copy, do not impl Namespace, Namespaced, serde deserialize disallow zero * tidy use statements * allow zero NamespaceId (changed my mind) * fix doc NsTable::validate * nice job, idiot * clarify doc on serde derivation for NsTable * clarify doc for NsTable::len * fix: byte length check in NsTable::validate * address #1607 (comment) * make NamespaceId Copy again * fix again: byte length check in NsTable::validate * address #1607 (comment)
- Loading branch information
Showing
14 changed files
with
372 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.