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

rpcdaemon: yParity field not conditioned to Erigon compatibility flag #1965

Merged
merged 3 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/rpc-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Checkout RPC Tests Repository & Install Requirements
run: |
rm -rf ${{runner.workspace}}/rpc-tests
git -c advice.detachedHead=false clone --depth 1 --branch v0.10.0 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests
git -c advice.detachedHead=false clone --depth 1 --branch v0.11.0 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests
cd ${{runner.workspace}}/rpc-tests
pip3 install -r requirements.txt

Expand Down
11 changes: 2 additions & 9 deletions silkworm/rpc/json/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ void to_json(nlohmann::json& json, const Transaction& transaction) {
json["chainId"] = rpc::to_quantity(*transaction.chain_id);
json["v"] = rpc::to_quantity(uint64_t(transaction.odd_y_parity));
json["accessList"] = transaction.access_list; // EIP2930
// Erigon currently at 2.48.1 does not yet support yParity field
if (!rpc::compatibility::is_erigon_json_api_compatibility_required()) {
json["yParity"] = rpc::to_quantity(transaction.odd_y_parity);
}
json["yParity"] = rpc::to_quantity(transaction.odd_y_parity);
} else if (transaction.chain_id) {
json["chainId"] = rpc::to_quantity(*transaction.chain_id);
json["v"] = rpc::to_quantity(silkworm::endian::to_big_compact(transaction.v()));
Expand Down Expand Up @@ -100,11 +97,7 @@ void make_glaze_json_transaction(const silkworm::Transaction& tx, GlazeJsonTrans
glaze_access_list.push_back(std::move(access_list_json_tx));
}
json_tx.access_list = std::make_optional(std::move(glaze_access_list));

// Erigon currently at 2.48.1 does not yet support yParity field
if (!rpc::compatibility::is_erigon_json_api_compatibility_required()) {
json_tx.yparity = std::make_optional(rpc::to_quantity(tx.odd_y_parity));
}
json_tx.yparity = std::make_optional(rpc::to_quantity(tx.odd_y_parity));
} else if (tx.chain_id) {
json_tx.chain_id = std::make_optional(to_quantity(*tx.chain_id));
to_quantity(std::span(json_tx.v), silkworm::endian::to_big_compact(tx.v()));
Expand Down
Loading