refactor(types): share HTTP commit certificate JSON types across evm-node and consensus#46
Open
crazywriter1 wants to merge 1 commit intocirclefin:mainfrom
Conversation
Add arc_consensus_types::commit_http (HttpCommitCertificate, HttpCommitSignature) and try_into_commit_certificate. Use from arc-evm-node get_certificate and malachite-app rpc_sync; RpcCommitCertificate HTTP response uses HttpCommitSignature. Add commit_http unit tests; serde_with dep + Cargo.lock.
Author
|
Hi @ZhiyuCircle following up on #40: I rebased onto the latest main and opened this PR with the same change set. Could you take a look when you have a moment? Thanks again for the guidance. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #40 (re-opened after
mainwas force-pushed and GitHub auto-closed the previous PR).Summary
Introduces
arc_consensus_types::commit_httpwithHttpCommitCertificate/HttpCommitSignatureandtry_into_commit_certificate()so the execution RPC (get_certificate) and consensus RPC sync paths deserialize the same JSON shape without duplicated structs.Motivation
The wire format (
height,round,block_hash, base64-encoded signature bytes) lived in two places, which risks drift and inconsistent handling. One shared module keeps JSON alignment betweenarc-evm-nodeandarc-node-consensus.Changes
crates/types/src/commit_http.rsandpub mod commit_httpinarc-consensus-types.serde_with(withbase64) toarc-consensus-types; updateCargo.lock.arc-evm-node: re-exportRpcCommitCertificatefromHttpCommitCertificate; remove duplicate local types.arc-node-consensus: deserialize viaHttpCommitCertificatein RPC sync; usetry_into_commit_certificate().malachite-appHTTPRpcCommitCertificateusesVec<HttpCommitSignature>for signatures (serialization unchanged).Testing
cargo test -p arc-consensus-typescargo test -p arc-evm-node get_certificatecargo test -p arc-node-consensus(useOPENSSL_NO_VENDOR=1if vendored OpenSSL build fails locally)cargo clippy -p arc-consensus-types -p arc-node-consensus -p arc-evm-node --all-targets -- -D warnings