-
Notifications
You must be signed in to change notification settings - Fork 95
refactor(api): define abci error codes in protobuf #647
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
Conversation
57f9c5b to
12ba88f
Compare
0db7eac to
d9273c1
Compare
| ABCI_ERROR_CODE_INVALID_PARAMETER = 2; | ||
| ABCI_ERROR_CODE_INTERNAL_ERROR = 3; | ||
| ABCI_ERROR_CODE_INVALID_NONCE = 4; | ||
| ABCI_ERROR_CODE_TRANSACTION_TOO_LARGE = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@noot I renamed this from INVALID_SIZE to make it slightly more specific/descriptive.
| /// This hashes each item before pushing it into the Merkle Tree, which | ||
| /// effectively causes a double hashing. The leaf hash of an item `d_i` | ||
| /// is then `MTH(d_i) = SHA256(0x00 || SHA256(d_i))`. | ||
| fn merkle_tree_from_transactions<I, B>(iter: I) -> merkle::Tree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no code changes here. Just moved this out of the sequencer-types crate as this was only used in conductor.
5f78d67 to
419028f
Compare
e909954 to
585fe66
Compare
419028f to
f454bd4
Compare
585fe66 to
ee36c7c
Compare
ee36c7c to
0a86d37
Compare
97dd791 to
f141fda
Compare
0a86d37 to
c6538c1
Compare
noot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
Summary
Define protobuf spec for ABCI error codes, remove sequencer-types crate.
Background
All public APIs should be defined in
astria-apiand the protobuf spec. This patch allows non-rust code to understand the abci codes emitted by sequencer.The abci return code convention of having
0be success and non-zero be an error does not cleanly map to the protobuf convention. Protobuf enums should have a default valueUNSPECIFIED = 0. We therefore go with the protobuf convention and define the enum type asAbciErrorCode.Changes
Testing
Tests making use of abci codes still work.
Related Issues
closes #369