From cdd67811c5f9ba7218eada3d20fd88ba12dc6fb5 Mon Sep 17 00:00:00 2001 From: Steven Sheehy Date: Wed, 1 Feb 2023 22:52:55 -0600 Subject: [PATCH] Fix for HIP validation Signed-off-by: Steven Sheehy --- HIP/HIP-668.md | 77 ++++++++++++++++---------------------------------- 1 file changed, 25 insertions(+), 52 deletions(-) diff --git a/HIP/HIP-668.md b/HIP/HIP-668.md index e718a8874..e52afe937 100644 --- a/HIP/HIP-668.md +++ b/HIP/HIP-668.md @@ -1,8 +1,8 @@ --- hip: 668 title: Mirror Node GraphQL API -author: Steven Sheehy <@steven-sheehy> -working-group: Daniel Costa +author: Steven Sheehy +working-group: Daniel Costa type: Standards Track category: Mirror needs-council-approval: Yes @@ -166,7 +166,7 @@ In addition to the built-in scalars, this API defines a few custom scalars. "An ISO 8601 compatible duration with support for nanoseconds granularity in the format P[n]Y[n]M[n]DT[n]H[n]M[n]S." scalar Duration -"A 64-bit numeric type." +"A 64-bit signed numeric type." scalar Long "A map-like object with dynamic key/value pairs." @@ -189,7 +189,7 @@ identifier and has a common set of fields defined by the `Entity` interface. "A specialization of an Entity appropriate for entities that have a Hbar balance." interface Accountable implements Entity & Node { "The account charged the auto-renewal fee." - autoRenewAccount: Account + autoRenewEntity: Accountable "The amount of time to elapse before auto-renew occurs." autoRenewPeriod: Duration @@ -252,9 +252,6 @@ interface Accountable implements Entity & Node { "A consensus timestamp range with an inclusive from timestamp and an exclusive to timestamp." timestamp: TimestampRange! - - "The type of Hedera entity." - type: EntityType! } "The encoding used to convert the raw bytes to String." @@ -272,7 +269,7 @@ across all entity types and associated with a particular shard and realm. """ interface Entity implements Node { "The account charged the auto-renewal fee." - autoRenewAccount: Account + autoRenewEntity: Accountable "The amount of time to elapse before auto-renew occurs." autoRenewPeriod: Duration @@ -297,7 +294,8 @@ interface Entity implements Node { """ The admin key associated with this entity whose signing requirements must be met in order to modify the entity on - the network. + the network. This returns a dynamic map that varies per entity and may be arbitrarily complex depending upon this + key's signing requirements. """ key: Object @@ -306,9 +304,6 @@ interface Entity implements Node { "A consensus timestamp range with an inclusive from timestamp and an exclusive to timestamp." timestamp: TimestampRange! - - "The type of Hedera entity." - type: EntityType! } "An incrementing identifier that is shared across all entity types and associated with a particular shard and realm." @@ -335,17 +330,6 @@ input EntityIdInput { shard: Long! = 0 @Min(value: 0) } -"The type of Hedera entity." -enum EntityType { - ACCOUNT - CONTRACT - FILE - SCHEDULE - TOKEN - TOPIC - UNKNOWN -} - "A rational number, used to provide an accurate number without any rounding issues and to provide consistency with HAPI." type Fraction { "The rational's denominator. Will be a value of one when the numerator should be treated as a whole number." @@ -496,7 +480,7 @@ type Account implements Accountable & Entity & Node { allowances: Allowances! "The account charged the auto-renewal fee." - autoRenewAccount: Account + autoRenewEntity: Accountable "The amount of time to elapse before auto-renew occurs." autoRenewPeriod: Duration @@ -577,9 +561,6 @@ type Account implements Accountable & Entity & Node { "Lists the transactions associated with this account." transactions(after: String, before: String, first: Int, last: Int): TransactionConnection! - - "The type of Hedera entity." - type: EntityType! } """ @@ -857,6 +838,12 @@ enum BlockType { Users can query their smart contract by its unique identifier and return associated info like the results or state. ```graphql +"The type of entity calling the contract." +enum CallerType { + ACCOUNT + CONTRACT +} + "The specific operation type of a call." enum CallOperationType { CALL @@ -871,7 +858,7 @@ enum CallOperationType { "Represents a Hedera contract on the network." type Contract implements Accountable & Entity & Node { "The account charged the auto-renewal fee." - autoRenewAccount: Account + autoRenewEntity: Accountable "The amount of time to elapse before auto-renew occurs." autoRenewPeriod: Duration @@ -952,9 +939,6 @@ type Contract implements Accountable & Entity & Node { "A consensus timestamp range with an inclusive from timestamp and an exclusive to timestamp." timestamp: TimestampRange! - - "The type of Hedera entity." - type: EntityType! } "A fine grained action within a contract result. Sometimes called 'internal transactions'." @@ -971,8 +955,8 @@ type ContractAction implements Node { "The entity calling the contract." caller: EntityId! - "The type of entity calling the contract. Can only be ACCOUNT or CONTRACT." - callerType: EntityType! + "The type of entity calling the contract." + callerType: CallerType! "The upper limit of gas this action can spend." gas: Long! @@ -1288,7 +1272,7 @@ Users can query for a specific Hedera file and its associated data. "Represents a file on the Hedera network to allow arbitrarily large byte sequences on the ledger." type File implements Entity & Node { "The account charged the auto-renewal fee." - autoRenewAccount: Account + autoRenewEntity: Accountable "The amount of time to elapse before auto-renew occurs." autoRenewPeriod: Duration @@ -1325,9 +1309,6 @@ type File implements Entity & Node { "A consensus timestamp range with an inclusive from timestamp and an exclusive to timestamp." timestamp: TimestampRange! - - "The type of Hedera entity." - type: EntityType! } "The chunked file contents associated with a Hedera file." @@ -1537,7 +1518,7 @@ Users can query for a specific Hedera Schedule. "A schedule entity allows a transaction to be scheduled for future execution." type Schedule implements Entity & Node { "The account charged the auto-renewal fee." - autoRenewAccount: Account + autoRenewEntity: Accountable "The amount of time to elapse before auto-renew occurs." autoRenewPeriod: Duration @@ -1585,9 +1566,6 @@ type Schedule implements Entity & Node { "The scheduled transaction body to be executed in the future. Encoded bytes of SchedulableTransactionBody protobuf." transactionBody(encoding: BinaryEncoding = BASE64): String! - "The type of Hedera entity." - type: EntityType! - """ Whether the scheduled transaction will be evaluated for execution at its expiration time instead of when all required signatures are received. @@ -1778,7 +1756,7 @@ type Token implements Entity & Node { accounts(after: String, before: String, first: Int, last: Int): TokenAssociationConnection! "The account charged the auto-renewal fee." - autoRenewAccount: Account + autoRenewEntity: Accountable "The amount of time to elapse before auto-renew occurs." autoRenewPeriod: Duration @@ -1877,9 +1855,6 @@ type Token implements Entity & Node { "The token class type for IWA compatibility." tokenType: TokenType! - "The type of Hedera entity." - type: EntityType! - "The key which can wipe the token balance of an account." wipeKey: Object } @@ -1918,7 +1893,7 @@ Users can query for a specific Hedera topic and its associated messages. "A Hedera topic provides aBFT consensus as to the order and validity of messages submitted to it." type Topic implements Entity & Node { "The account charged the auto-renewal fee." - autoRenewAccount: Account + autoRenewEntity: Accountable "The amount of time to elapse before auto-renew occurs." autoRenewPeriod: Duration @@ -1962,9 +1937,6 @@ type Topic implements Entity & Node { "A consensus timestamp range with an inclusive from timestamp and an exclusive to timestamp." timestamp: TimestampRange! - - "The type of Hedera entity." - type: EntityType! } "The unique identifier to get a specific topic." @@ -2245,7 +2217,7 @@ type Transfers { ## Backwards Compatibility This HIP introduces a new mirror node API and as such introduces no backwards compatibility concerns. The existing -mirror node REST API will continue to be maintained. +mirror node REST API will continue to be maintained and new features will be added to both APIs going forward. ## Security Implications @@ -2269,7 +2241,7 @@ exact query depth will be determined based upon performance testing. Limiting each list is necessary to reduce the multiplier of having nested queries. Any list will be limited to at most 100 items. Each of those list could potentially contain other lists who are each similarly constrained to 100 items -and so on. +and so on. The exact number may change in the future depending upon performance testing. ### Query Complexity Limit @@ -2308,7 +2280,8 @@ available queries. Additional documentation will be provided by Hedera to instru A reference implementation is underway on the Mirror Node GitHub repository. The results of this effort will manifest themselves as a new `hedera-mirror-graphql` module and associated microservice. GitHub issues labeled with [graphql](https://github.com/hashgraph/hedera-mirror-node/issues?q=is%3Aissue+is%3Aopen+graphql+label%3Agraphql) -can be used by interested parties to track the progress of this work. +or the GraphQL API [epic](https://github.com/hashgraph/hedera-mirror-node/issues/5304) can be used by interested +parties to track the progress of this work. ## Rejected Ideas