Skip to content

Commit

Permalink
rpcdaemon: fix container-overflow detected by fuzzer on eth_feeHistory (
Browse files Browse the repository at this point in the history
#2531)

Co-authored-by: canepat <16927169+canepat@users.noreply.github.com>
  • Loading branch information
lupin012 and canepat authored Nov 24, 2024
1 parent 0819d5f commit ca3acdb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rpc-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,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 v1.18.0 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests
git -c advice.detachedHead=false clone --depth 1 --branch v1.19.0 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests
cd ${{runner.workspace}}/rpc-tests
pip3 install -r requirements.txt --break-system-packages
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/run_integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ rm -rf ./mainnet/results/
# erigon_getLatestLogs: new algo using TKV
# eth_getLogs: new algo using TKV
# ots_getContractCreator: new algo using TKV
# ots_searchTransactionsAfter: new algo using TKV
# ots_searchTransactionsBefore: new algo using TKV


python3 ./run_tests.py --continue --blockchain mainnet --jwt "$2" --display-only-fail --json-diff --port 51515 --transport_type http,websocket -x \
debug_accountRange,\
Expand Down Expand Up @@ -46,11 +45,11 @@ debug_traceTransaction/test_90.tar,\
debug_traceTransaction/test_91.tar,\
debug_traceTransaction/test_92.tar,\
debug_traceTransaction/test_96.json,\
trace_replayBlockTransactions/test_29,\
engine_,\
erigon_getLatestLogs,\
eth_getLogs,\
ots_getContractCreator,\
ots_searchTransactionsAfter
ots_getContractCreator

failed_test=$?

Expand Down
11 changes: 1 addition & 10 deletions silkworm/rpc/core/fee_history_oracle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,7 @@ void to_json(nlohmann::json& json, const FeeHistory& fh) {
if (fh.blob_gas_used_ratio.empty()) {
json["blobGasUsedRatio"] = nullptr;
} else {
auto json1 = nlohmann::json::array();
for (size_t k{0}; k < fh.blob_gas_used_ratio.size(); ++k) {
auto& value{fh.blob_gas_used_ratio[k]};
if (value == 0) {
json1.push_back(0);
} else {
json1.push_back(value);
}
}
json["blobGasUsedRatio"] = json1;
json["blobGasUsedRatio"] = fh.blob_gas_used_ratio;
}
json["oldestBlock"] = to_quantity(fh.oldest_block);

Expand Down

0 comments on commit ca3acdb

Please sign in to comment.