github hashgraph/hedera-mirror-node v0.57.0

latest releases: v0.118.0, v0.117.1, v0.118.0-rc1...
2 years ago

This release is focused on adding the necessary data and APIs needed for the JSON-RPC Relay defined in HIP-482. The JSON-RPC Relay implements the Ethereum JSON-RPC standard and relays HIP-410 Ethereum transactions to consensus nodes. Since the concept of a block is crucial for JSON-RPC APIs, this release also contains the implementation of HIP-415 Introduction of Blocks.

The mirror node now exposes the concept of blocks as introduced in HIP-415. We now calculate and store the cumulative gas used and the contract log bloom filter for the block as a whole. This HIP defines three new REST APIs and this release includes all three: a list blocks REST API, a get blocks REST API, and a list contract results REST API. The new /api/v1/blocks API supports the usual limit and order query parameters along with timestamp and block.number to support equality and range operators for consensus timestamps and block numbers, respectively. The /api/v1/blocks/{hashOrNumber} is identical to the list blocks but only returns a single block by either its block hash or its block number. Finally, a /api/v1/contracts/results REST API was added that is identical to the existing /api/v1/contracts/{id}/results but able to search across contracts.

GET /api/v1/blocks

{
  "blocks": [{
    "count": 4,
    "gas_limit": 150000000,
    "gas_used": 50000000,
    "hapi_version": "0.24.0",
    "hash": "0xa4ef824cd63a325586bfe1a66396424cd33499f895db2ce2292996e2fc5667a69d83a48f3883f2acab0edfb6bfeb23c4",
    "logs_bloom": "0x549358c4c2e573e02410ef7b5a5ffa5f36dd7398",
    "name": "2022-04-07T16_59_23.159846673Z.rcd",
    "number": 19533336,
    "previous_hash": "0x4fbcefec4d07c60364ac42286d5dd989bc09c57acc7370b46fa8860de4b8721e63a5ed46addf1564e4f8cd7b956a5afa",
    "size": 8489,
    "timestamp": {
      "from": "1649350763.159846673",
      "to": "1649350763.382130000"
    }
  }],
  "links": {
    "next": null
  }
}

GET /api/v1/blocks/{hashOrNumber}

{
  "count": 4,
  "gas_limit": 150000000,
  "gas_used": 50000000,
  "hapi_version": "0.24.0",
  "hash": "0xa4ef824cd63a325586bfe1a66396424cd33499f895db2ce2292996e2fc5667a69d83a48f3883f2acab0edfb6bfeb23c4",
  "logs_bloom": "0x549358c4c2e573e02410ef7b5a5ffa5f36dd7398",
  "name": "2022-04-07T16_59_23.159846673Z.rcd",
  "number": 19533336,
  "previous_hash": "0x4fbcefec4d07c60364ac42286d5dd989bc09c57acc7370b46fa8860de4b8721e63a5ed46addf1564e4f8cd7b956a5afa",
  "size": 8489,
  "timestamp": {
    "from": "1649350763.159846673"
    "to": "1649350763.382130000"
  }
}

A number of changes were made in support of HIP-410 Ethereum Transactions. The /api/v1/accounts/{idOrAlias} REST API was updated to accept an EVM address as a path parameter in lieu of an ID or alias. An ethereum_nonce and evm_address was added to the response of /api/v1/accounts/{idOrAliasOrAddress} and /api/v1/accounts. The existing /api/v1/contracts/results/{transactionId} was updated to accept the 32 byte Ethereum transaction hash as a path parameter in addition to the transaction ID that it supports now. Its response, as well as the similar /api/v1/contracts/{idOrAddress}/results/{timestamp}, was updated to add the following new Ethereum transaction fields:

{
  "access_list": "0xabcd...",
  "block_gas_used": 564684,
  "chain_id": "0x0127",
  "gas_price": "0xabcd...",
  "max_fee_per_gas": "0xabcd...",
  "max_priority_fee_per_gas": "0xabcd...",
  "nonce": 1,
  "r": "0x84f0...",
  "s": "0x5e03...",
  "transaction_index": 1,
  "type": 2,
  "v": 0
}

Note: Existing fields omitted for brevity.

A new exchange rate REST API /api/v1/network/exchangerate was added that returns the exchange rate network file stored in 0.0.112. It supports a timestamp parameter to retrieve the exchange rate at a certain time in the past.

{
  "current_rate": {
    "cent_equivalent": 596987
    "expiration_time": 1649689200
    "hbar_equivalent": 30000
  },
  "next_rate": {
    "cent_equivalent": 594920
    "expiration_time": 1649692800
    "hbar_equivalent": 30000
  },
  "timestamp": "1649689200.123456789"
}

A new /api/v1/contracts/results/logs API was added with the same query parameters and response as /api/v1/contracts/{address}/results/logs but with the ability to search across contracts. It does not support address as a query parameter as it’s expected users use the existing API if they need logs for a specific address. The same rules around not exceeding maxTimestampRange still applies and allows it to stay performant. Pagination is possible using a combination of the timestamp and index query parameters.

Finally, this releases completes our implementation of HIP-423 Long Term Scheduled Transactions. Two new fields wait_for_expiry and expiration_time were added to /api/v1/schedules and /api/v1/schedules/{id}.

Enhancements

  • Flatten NFT transfer chain (0.57) #3817
  • Update block number mapping in migration to latest values #3807
  • Add fields to contract result details #3800
  • Populate ethereum nonce #3798
  • Add ethereum nonce and evm address to accounts rest api #3767
  • Set cache control for exchangerate endpoint #3765
  • Search contract result details by eth hash #3764
  • Add support for exchange rate rest api endpoint #3757
  • 03591 add new fields to schedules #3733
  • Aggregate Block Information #3721
  • Get block REST API #3718
  • Add a list contracts logs REST API #3717
  • Bump versions for v0.57.0-SNAPSHOT #3716
  • HIP-410 Add ethereum_nonce & evm_address to accounts REST API #3680
  • Dynamically generate v2 backup & restore SQL #3679
  • HIP-410 Populate ethereum nonce #3678
  • Add a list contract results REST API #3674
  • Add a list blocks REST API #3669
  • HIP-423 Add new fields to schedule REST APIs #3591
  • List Contract Results REST API #3587
  • Add fields to Get Contract Result REST API #3586
  • Add transaction hash path parameter to Get Contract Results REST API #3585
  • Aggregate block information #3584
  • Contract Logs REST API #3582
  • Exchange Rate REST API #3579
  • Get Block REST API #3577
  • Update acceptance tests w AddressBookServiceEndpoint support #3183
  • List Blocks REST API #1933

Bug Fixes

  • Add on error event listeners to pg pool and clients #3805
  • Handle pg.Pool and pg.Client on error events in hedera-mirror-rest #3804
  • Fix EthereumParser transaction type choice logic #3770
  • Update OpenAPI spec w missing exchangerate and allowance info #3763
  • Fix EVM address migration #3760
  • AccountEvmAddressMigration failure on testnet #3759
  • Fix allowance acceptance tests #3758
  • OpenAPI spec example missing nft allowance info #3756
  • Allowance acceptance tests fail #3752
  • Fill missing contract fileId / initcode #3751
  • Fix E2E metric #3737
  • Broken E2E metric #3736
  • Drop from_address in ethereum_transaction #3731
  • Fix js monitor stateproof check not setting nonce / scheduled query params #3730
  • Importer fails to parse empty senderId on unsuccessful ethereumtransaction #3728
  • js monitor does not pass nonce / scheduled query param #3726
  • Fix incorrect token balance values returned in rest api #3719
  • Add migration to retrieve missing FileId in child ContractCreate transactions #3671
  • Incorrect token balance values returned in REST API #3612

Dependency Upgrades

  • Bump aws-sdk from 2.1130.0 to 2.1136.0 in /hedera-mirror-rest #3803
  • Bump testcontainers from 8.10.0 to 8.10.1 in /hedera-mirror-rest #3802
  • Bump asn1js from 2.4.0 to 3.0.3 in /hedera-mirror-rest #3801
  • Bump yargs from 17.4.1 to 17.5.0 in /hedera-mirror-rest/check-state-proof #3791
  • Bump glob from 8.0.1 to 8.0.3 in /hedera-mirror-rest/check-state-proof #3790
  • Bump log4js from 6.4.6 to 6.4.7 in /hedera-mirror-rest/check-state-proof #3789
  • Bump github.com/hashgraph/hedera-sdk-go/v2 from 2.13.3 to 2.13.4 in /hedera-mirror-rosetta #3788
  • Bump github.com/prometheus/client_golang from 1.12.1 to 1.12.2 in /hedera-mirror-rosetta #3787
  • Bump headlong from 6.3.0 to 6.3.1 #3786
  • Bump spring-native from 0.11.4 to 0.11.5 #3785
  • Bump vertx-pg-client from 4.2.7 to 4.3.0 #3783
  • Bump mathjs from 10.5.2 to 10.5.3 in /hedera-mirror-rest #3782
  • Bump software.amazon.awssdk:bom from 2.17.186 to 2.17.191 #3781
  • Bump eslint-plugin-jest from 26.1.5 to 26.2.2 in /hedera-mirror-rest #3780
  • Bump log4js from 6.4.6 to 6.4.7 in /hedera-mirror-rest #3779
  • Bump swagger-ui-express from 4.3.0 to 4.4.0 in /hedera-mirror-rest #3778
  • Bump log4js from 6.4.6 to 6.4.7 in /hedera-mirror-rest/monitoring/monitor_apis #3777
  • Bump mathjs from 10.5.1 to 10.5.3 in /hedera-mirror-rest/monitoring/monitor_apis #3776
  • Bump mathjs from 10.5.1 to 10.5.2 in /hedera-mirror-rest #3755
  • Bump husky from 8.0.0 to 8.0.1 in /hedera-mirror-rest #3754
  • Bump aws-sdk from 2.1126.0 to 2.1130.0 in /hedera-mirror-rest #3753
  • Bump jest from 28.0.3 to 28.1.0 in /hedera-mirror-rest/check-state-proof #3749
  • Bump github.com/hashgraph/hedera-sdk-go/v2 from 2.13.1 to 2.13.3 in /hedera-mirror-rosetta #3748
  • Bump headlong from 6.2.0 to 6.3.0 #3747
  • Bump hibernate-types-52 from 2.16.1 to 2.16.2 #3746
  • Bump software.amazon.awssdk:bom from 2.17.182 to 2.17.186 #3745
  • Bump testcontainers from 8.9.0 to 8.10.0 in /hedera-mirror-rest #3744
  • Bump sinon from 13.0.2 to 14.0.0 in /hedera-mirror-rest #3743
  • Bump jest from 28.0.3 to 28.1.0 in /hedera-mirror-rest #3742
  • Bump jest from 28.0.3 to 28.1.0 in /hedera-mirror-rest/monitoring/monitor_apis #3741
  • Bump jest-circus from 28.0.3 to 28.1.0 in /hedera-mirror-rest #3740
  • Bump husky from 7.0.4 to 8.0.0 in /hedera-mirror-rest #3739
  • Bump mathjs from 10.5.0 to 10.5.1 in /hedera-mirror-rest/monitoring/monitor_apis #3738
  • Bump @hashgraph/proto from 2.4.0 to 2.4.2 in /hedera-mirror-rest #3714

Contributors

We'd like to thank all the contributors who worked on this release!

Don't miss a new hedera-mirror-node release

NewReleases is sending notifications on new releases.