From 650649ad0f7d07447741dba74e9ee4cf654ad0c5 Mon Sep 17 00:00:00 2001 From: Michael Tinker Date: Wed, 4 Sep 2024 12:32:08 -0500 Subject: [PATCH 1/8] Add needed TransactionOutput fields Signed-off-by: Michael Tinker --- block/stream/output/schedule_service.proto | 11 +++++++ .../output/smart_contract_service.proto | 22 ++++++++++++- block/stream/output/token_service.proto | 31 +++++++++++++++++++ block/stream/output/transaction_output.proto | 6 ++++ .../state/blockstream/block_stream_info.proto | 11 +++++-- 5 files changed, 78 insertions(+), 3 deletions(-) diff --git a/block/stream/output/schedule_service.proto b/block/stream/output/schedule_service.proto index 059977e7..7e8d8451 100644 --- a/block/stream/output/schedule_service.proto +++ b/block/stream/output/schedule_service.proto @@ -64,6 +64,17 @@ import "basic_types.proto"; * the original transaction. */ message CreateScheduleOutput { + /** + * A schedule identifier. + *

+ * If the status of the transaction is `SUCCESS`, this value SHALL be + * set to the identifier of the schedule that was created. If the + * transaction status is `IDENTICAL_SCHEDULE_ALREADY_CREATED`, this + * value SHALL be set to the identifier of the existing schedule that + * is identical to the one that was attempted to be created. For any + * other status, this value SHALL NOT be set. + */ + proto.ScheduleID schedule_id = 1; /** * A scheduled transaction identifier. *

diff --git a/block/stream/output/smart_contract_service.proto b/block/stream/output/smart_contract_service.proto index 81062c26..8911844c 100644 --- a/block/stream/output/smart_contract_service.proto +++ b/block/stream/output/smart_contract_service.proto @@ -135,7 +135,27 @@ message EthereumOutput { /** * An ethereum hash value. *

- * This SHALL be a keccak256 hash of the ethereumData. + * This SHALL be a keccak256 hash of the ethereumData, after + * interpolating the calldata from the referenced calldata file + * (if set). */ bytes ethereum_hash = 2; + + oneof eth_result { + /** + * A result for an Ethereum Transaction executed as a call. + *

+ * This field SHALL contain all of the data produced by the contract + * call transaction as well as basic accounting results. + */ + proto.ContractFunctionResult ethereum_call_result = 3; + + /** + * A result for an Ethereum Transaction executed as a create. + *

+ * This field SHALL contain all of the data produced by the contract + * create transaction as well as basic accounting results. + */ + proto.ContractFunctionResult ethereum_create_result = 4; + } } diff --git a/block/stream/output/token_service.proto b/block/stream/output/token_service.proto index 4b9c7983..fa8f2bc5 100644 --- a/block/stream/output/token_service.proto +++ b/block/stream/output/token_service.proto @@ -34,6 +34,9 @@ option java_package = "com.hedera.hapi.block.stream.output.protoc"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; +import "custom_fees.proto"; +import "transaction_record.proto"; + /** * Block Stream data for a `createToken` transaction. * @@ -161,3 +164,31 @@ message UnpauseTokenOutput {} * the original transaction. */ message UpdateTokenNftsOutput {} + +/** + * Block Stream data for a `tokenAirdrop` transaction. + * + * This message SHALL NOT duplicate information already contained in + * the original transaction. + */ +message TokenAirdropOutput { + /** + * Custom fees assessed during a TokenAirdrop. + *

+ * These fees SHALL be present in the full transfer list for the transaction. + */ + repeated proto.AssessedCustomFee assessed_custom_fees = 1; + + /** + * A list of pending token airdrops. + * Each pending airdrop represents a single requested transfer from a + * sending account to a recipient account. These pending transfers are + * issued unilaterally by the sending account, and MUST be claimed by the + * recipient account before the transfer MAY complete. + * A sender MAY cancel a pending airdrop before it is claimed. + * An airdrop transaction SHALL emit a pending airdrop when the recipient has no + * available automatic association slots available or when the recipient + * has set `receiver_sig_required`. + */ + repeated proto.PendingAirdropRecord new_pending_airdrops = 2; +} diff --git a/block/stream/output/transaction_output.proto b/block/stream/output/transaction_output.proto index e1dc8e6e..7730c60f 100644 --- a/block/stream/output/transaction_output.proto +++ b/block/stream/output/transaction_output.proto @@ -38,6 +38,7 @@ option java_multiple_files = true; import "stream/output/schedule_service.proto"; import "stream/output/util_service.proto"; import "stream/output/crypto_service.proto"; +import "stream/output/token_service.proto"; import "stream/output/smart_contract_service.proto"; /** @@ -149,5 +150,10 @@ message TransactionOutput { * executing the scheduled transaction. */ SignScheduleOutput sign_schedule = 7; + + /** + * Output from a token airdrop transaction. + */ + TokenAirdropOutput token_airdrop = 8; } } diff --git a/services/state/blockstream/block_stream_info.proto b/services/state/blockstream/block_stream_info.proto index df6c6185..aaff45a8 100644 --- a/services/state/blockstream/block_stream_info.proto +++ b/services/state/blockstream/block_stream_info.proto @@ -59,8 +59,8 @@ message BlockStreamInfo { /** * A consensus time for the current block.
- * This is the _first_ consensus time in the current block, and - * is used to determine if this block was the first across an + * This is the consensus time of the first round in the current block, + * and is used to determine if this block was the first across an * important boundary in consensus time, such as UTC midnight. * This may also be used to purge entities expiring between the last * block time and this time. @@ -72,6 +72,7 @@ message BlockStreamInfo { * This combines several trailing output block item hashes and * is used as a seed value for a pseudo-random number generator.
* This is also requiried to implement the EVM `PREVRANDAO` opcode. + * This MUST contain at least 256 bits of entropy. */ bytes trailing_output_hashes = 3; @@ -83,6 +84,12 @@ message BlockStreamInfo { * hash SHALL be for block number N-256.
* The latest available hash SHALL be for block N-1.
* This is REQUIRED to implement the EVM `BLOCKHASH` opcode. + *

+ *

Field Length
+ * Each hash value SHALL be the trailing 265 bits of a SHA2-384 hash.
+ * The length of this field SHALL be an integer multiple of 32 bytes.
+ * This field SHALL be at least 32 bytes.
+ * The maximum length of this field SHALL be 8192 bytes. */ bytes trailing_block_hashes = 4; } From 2da61117426aae2372327ddfd8c82c5e57191e42 Mon Sep 17 00:00:00 2001 From: Michael Tinker Date: Wed, 4 Sep 2024 15:01:51 -0500 Subject: [PATCH 2/8] Update services/state/blockstream/block_stream_info.proto Co-authored-by: Joseph S. <121976561+jsync-swirlds@users.noreply.github.com> Signed-off-by: Michael Tinker --- services/state/blockstream/block_stream_info.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/state/blockstream/block_stream_info.proto b/services/state/blockstream/block_stream_info.proto index aaff45a8..d45da9a0 100644 --- a/services/state/blockstream/block_stream_info.proto +++ b/services/state/blockstream/block_stream_info.proto @@ -71,7 +71,7 @@ message BlockStreamInfo { * A concatenation of hash values.
* This combines several trailing output block item hashes and * is used as a seed value for a pseudo-random number generator.
- * This is also requiried to implement the EVM `PREVRANDAO` opcode. + * This is also requiried to implement the EVM `PREVRANDAO` opcode.
* This MUST contain at least 256 bits of entropy. */ bytes trailing_output_hashes = 3; From dcfab770c07ef82ef258c0898953465eac4cc6ba Mon Sep 17 00:00:00 2001 From: Michael Tinker Date: Wed, 4 Sep 2024 15:07:12 -0500 Subject: [PATCH 3/8] Update block/stream/output/smart_contract_service.proto Co-authored-by: Joseph S. <121976561+jsync-swirlds@users.noreply.github.com> Signed-off-by: Michael Tinker --- block/stream/output/smart_contract_service.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/stream/output/smart_contract_service.proto b/block/stream/output/smart_contract_service.proto index 8911844c..7abec9ca 100644 --- a/block/stream/output/smart_contract_service.proto +++ b/block/stream/output/smart_contract_service.proto @@ -151,7 +151,7 @@ message EthereumOutput { proto.ContractFunctionResult ethereum_call_result = 3; /** - * A result for an Ethereum Transaction executed as a create. + * A result for an Ethereum _contract create_ transaction. *

* This field SHALL contain all of the data produced by the contract * create transaction as well as basic accounting results. From db16f06ee61b85ee21eae1295a598a0da334d8f2 Mon Sep 17 00:00:00 2001 From: Michael Tinker Date: Wed, 4 Sep 2024 15:07:20 -0500 Subject: [PATCH 4/8] Update block/stream/output/smart_contract_service.proto Co-authored-by: Joseph S. <121976561+jsync-swirlds@users.noreply.github.com> Signed-off-by: Michael Tinker --- block/stream/output/smart_contract_service.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/stream/output/smart_contract_service.proto b/block/stream/output/smart_contract_service.proto index 7abec9ca..3585a051 100644 --- a/block/stream/output/smart_contract_service.proto +++ b/block/stream/output/smart_contract_service.proto @@ -143,7 +143,7 @@ message EthereumOutput { oneof eth_result { /** - * A result for an Ethereum Transaction executed as a call. + * A result for an Ethereum _contract call_ transaction. *

* This field SHALL contain all of the data produced by the contract * call transaction as well as basic accounting results. From 80e822843c8f4ff454c82aa7a52982f5b7143fed Mon Sep 17 00:00:00 2001 From: Michael Tinker Date: Wed, 4 Sep 2024 15:07:29 -0500 Subject: [PATCH 5/8] Update block/stream/output/token_service.proto Co-authored-by: Joseph S. <121976561+jsync-swirlds@users.noreply.github.com> Signed-off-by: Michael Tinker --- block/stream/output/token_service.proto | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/block/stream/output/token_service.proto b/block/stream/output/token_service.proto index fa8f2bc5..3cf90e90 100644 --- a/block/stream/output/token_service.proto +++ b/block/stream/output/token_service.proto @@ -181,14 +181,16 @@ message TokenAirdropOutput { /** * A list of pending token airdrops. - * Each pending airdrop represents a single requested transfer from a - * sending account to a recipient account. These pending transfers are - * issued unilaterally by the sending account, and MUST be claimed by the - * recipient account before the transfer MAY complete. - * A sender MAY cancel a pending airdrop before it is claimed. - * An airdrop transaction SHALL emit a pending airdrop when the recipient has no - * available automatic association slots available or when the recipient - * has set `receiver_sig_required`. + * Each entry in this list SHALL represent a single requested transfer.
+ * Each entry SHALL specify a single sending account and a + * single recipient account.
+ * Each pending airdrop SHALL be requested unilaterally by the sending + * account, and MUST be claimed by the recipient account before the + * transfer can be completed.
+ * A sender MAY cancel a pending airdrop before it is claimed.
+ * An airdrop transaction SHALL emit a pending airdrop when the recipient + * has no available automatic association slots available or when the + * recipient has set `receiver_sig_required`. */ repeated proto.PendingAirdropRecord new_pending_airdrops = 2; } From 2ad3213734801e0df5113c702b307e5509f47aec Mon Sep 17 00:00:00 2001 From: Michael Tinker Date: Wed, 4 Sep 2024 15:07:41 -0500 Subject: [PATCH 6/8] Update block/stream/output/schedule_service.proto Co-authored-by: Joseph S. <121976561+jsync-swirlds@users.noreply.github.com> Signed-off-by: Michael Tinker --- block/stream/output/schedule_service.proto | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block/stream/output/schedule_service.proto b/block/stream/output/schedule_service.proto index 7e8d8451..b18d6c98 100644 --- a/block/stream/output/schedule_service.proto +++ b/block/stream/output/schedule_service.proto @@ -68,11 +68,11 @@ message CreateScheduleOutput { * A schedule identifier. *

* If the status of the transaction is `SUCCESS`, this value SHALL be - * set to the identifier of the schedule that was created. If the - * transaction status is `IDENTICAL_SCHEDULE_ALREADY_CREATED`, this - * value SHALL be set to the identifier of the existing schedule that - * is identical to the one that was attempted to be created. For any - * other status, this value SHALL NOT be set. + * set to the identifier of the schedule that was created.
+ * If the transaction status is `IDENTICAL_SCHEDULE_ALREADY_CREATED`, + * this value SHALL be set to the identifier of an existing schedule + * that is identical to the one that was requested.
+ * For any other status, this value SHALL NOT be set. */ proto.ScheduleID schedule_id = 1; /** From b073680cba1c4afbcca79ae6201ad4490b98b8c1 Mon Sep 17 00:00:00 2001 From: Michael Tinker Date: Thu, 5 Sep 2024 09:06:50 -0500 Subject: [PATCH 7/8] Remove new_pending_airdrops field Signed-off-by: Michael Tinker --- block/stream/output/token_service.proto | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/block/stream/output/token_service.proto b/block/stream/output/token_service.proto index fa8f2bc5..c4a8fa25 100644 --- a/block/stream/output/token_service.proto +++ b/block/stream/output/token_service.proto @@ -178,17 +178,4 @@ message TokenAirdropOutput { * These fees SHALL be present in the full transfer list for the transaction. */ repeated proto.AssessedCustomFee assessed_custom_fees = 1; - - /** - * A list of pending token airdrops. - * Each pending airdrop represents a single requested transfer from a - * sending account to a recipient account. These pending transfers are - * issued unilaterally by the sending account, and MUST be claimed by the - * recipient account before the transfer MAY complete. - * A sender MAY cancel a pending airdrop before it is claimed. - * An airdrop transaction SHALL emit a pending airdrop when the recipient has no - * available automatic association slots available or when the recipient - * has set `receiver_sig_required`. - */ - repeated proto.PendingAirdropRecord new_pending_airdrops = 2; } From 3fc72d36d589bd0337bfe9e2dec23ffbd5b51070 Mon Sep 17 00:00:00 2001 From: Michael Tinker Date: Thu, 5 Sep 2024 09:07:57 -0500 Subject: [PATCH 8/8] Update block/stream/output/smart_contract_service.proto Co-authored-by: Joseph S. <121976561+jsync-swirlds@users.noreply.github.com> Signed-off-by: Michael Tinker --- block/stream/output/smart_contract_service.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/stream/output/smart_contract_service.proto b/block/stream/output/smart_contract_service.proto index 3585a051..887672af 100644 --- a/block/stream/output/smart_contract_service.proto +++ b/block/stream/output/smart_contract_service.proto @@ -135,9 +135,9 @@ message EthereumOutput { /** * An ethereum hash value. *

- * This SHALL be a keccak256 hash of the ethereumData, after - * interpolating the calldata from the referenced calldata file - * (if set). + * This SHALL be a keccak256 hash of the ethereumData
+ * This hash SHALL be computed strictly _after_ interpolating + * the calldata from the calldata file (if set). */ bytes ethereum_hash = 2;