Skip to content

Commit

Permalink
chore: resolve comments
Browse files Browse the repository at this point in the history
Signed-off-by: nikolay <[email protected]>
  • Loading branch information
natanasow committed Oct 31, 2024
1 parent d519066 commit 31e6e99
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Unless you need to set a non-default value, it is recommended to only populate o
| `ETH_CALL_CONSENSUS_SELECTORS` | [""] | A comma-separated list of special transaction selectors that should always be routed to the Consensus node. |
| `ETH_GET_LOGS_BLOCK_RANGE_LIMIT` | "1000" | The maximum block number range to consider during an eth_getLogs call. |
| `ETH_GET_TRANSACTION_COUNT_MAX_BLOCK_RANGE` | "1000" | The maximum number of transactions to return when running eth_getBlockByHash or eth_getBlockByNumber with transaction objects set to true call. |
| `HEDERA_SPECIFIC_REVERT_STATUSES` | ["WRONG_NONCE", "INVALID_ACCOUNT_ID"] | The maximum number of transactions to return when running eth_getBlockByHash or eth_getBlockByNumber with transaction objects set to true call. |
| `HEDERA_SPECIFIC_REVERT_STATUSES` | ["WRONG_NONCE", "INVALID_ACCOUNT_ID"] | A list of specific transaction statuses where each one identifies that the transaction hadn't been executed in the evm but it had reached the services. |
| `FEE_HISTORY_MAX_RESULTS` | "10" | The maximum number of results to returns as part of `eth_feeHistory`. |
| `ETH_FEE_HISTORY_FIXED` | "true" | Flag to set if eth_feeHistory should return a fixed fee for the set of results. |
| `GAS_PRICE_PERCENTAGE_BUFFER` | "0" | The additional buffer that adds a percentage on top of the calculated network gasPrice. This may be used by operators to reduce the chances of `INSUFFICIENT_TX_FEE` errors experienced by users caused by minor fluctuations in the exchange rate. |
Expand Down
3 changes: 3 additions & 0 deletions packages/relay/src/lib/eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2302,6 +2302,9 @@ export class EthImpl implements Eth {
// there are several hedera-specific validations that occur right before entering the evm
// if a transaction has reverted there, we should not include that tx in the block response
if (Utils.isRevertedDueToHederaSpecificValidation(contractResult)) {
this.logger.debug(
`Transaction with hash ${contractResult.hash} is skipped due to hedera-specific validation failure`,
);
continue;
}
contractResult.from = await this.resolveEvmAddress(contractResult.from, requestDetails, [constants.TYPE_ACCOUNT]);
Expand Down
15 changes: 12 additions & 3 deletions packages/relay/tests/lib/eth/eth_getBlockByNumber.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,16 @@ describe('@ethGetBlockByNumber using MirrorNode', async function () {
restMock.onGet(CONTRACT_RESULTS_WITH_FILTER_URL).reply(200, {
results: [
...defaultContractResults.results,
{ ...defaultContractResults.results[0], result: status },
{ ...defaultContractResults.results[0], error_message: prepend0x(ASCIIToHex(status)) },
{
...defaultContractResults.results[0],
result: status,
hash: '0xf84b9a38205131431901ca6a945046369f5be81bb579167458d4992427d03bb1',
},
{
...defaultContractResults.results[0],
error_message: prepend0x(ASCIIToHex(status)),
hash: '0x9c8d9d99e033c56bec1669a0ea68887b7df69ec1bac55899150b6ed5bc3f4b79',
},
],
});
restMock.onGet(CONTRACT_RESULTS_LOGS_WITH_FILTER_URL).reply(200, DEFAULT_ETH_GET_BLOCK_BY_LOGS);
Expand All @@ -592,7 +600,8 @@ describe('@ethGetBlockByNumber using MirrorNode', async function () {
number: BLOCK_NUMBER_HEX,
parentHash: BLOCK_HASH_PREV_TRIMMED,
timestamp: BLOCK_TIMESTAMP_HEX,
transactions: [CONTRACT_HASH_1, CONTRACT_HASH_2], // should not include the transaction with wrong nonce
// should not include the transaction with wrong nonce or invalid account id
transactions: [CONTRACT_HASH_1, CONTRACT_HASH_2],
receiptsRoot: DEFAULT_BLOCK_RECEIPTS_ROOT_HASH,
},
showDetails,
Expand Down

0 comments on commit 31e6e99

Please sign in to comment.