Skip to content

Update HIP-1056: Contract Service output and trace specification - #1229

Merged
mgarbs merged 7 commits into
hiero-ledger:mainfrom
tinker-michaelj:contract-service-block-streams
Sep 17, 2025
Merged

Update HIP-1056: Contract Service output and trace specification#1229
mgarbs merged 7 commits into
hiero-ledger:mainfrom
tinker-michaelj:contract-service-block-streams

Conversation

@tinker-michaelj

Copy link
Copy Markdown
Contributor

Description:

  • Updates the spec for the normalized and deduplicated Smart Contract trace and output data.
  • The V6 record stream is proven to be recoverable from these block stream items; please see the PRs closing the sub-issues of this issue.
    • For 100% fidelity in recovering the legacy ContractFunctionResult#contract_nonces field, a stream consumer does need to maintain the current nonce of each contract account; but the goal for this ContractFunctionResult#contract_nonces field was only to keep stream consumers up-to-date on nonces; and this is trivially achieved using the block stream StateChanges now.

Signed-off-by: Michael Tinker <michael.tinker@swirldslabs.com>
@tinker-michaelj
tinker-michaelj requested a review from a team as a code owner June 27, 2025 16:19
jsync-swirlds
jsync-swirlds previously approved these changes Jun 27, 2025

@jsync-swirlds jsync-swirlds left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just some minor items to consider.
Perhaps @jasperpotts could take a quick look to ensure we aren't duplicating data more than necessary.

Comment thread HIP/hip-1056.md Outdated
Comment thread HIP/hip-1056.md Outdated
Comment thread HIP/hip-1056.md Outdated
Comment thread assets/hip-1056/protobuf/stream/output/smart_contract_service.proto Outdated
Comment thread assets/hip-1056/protobuf/stream/trace/smart_contract_service.proto Outdated
Comment thread assets/hip-1056/protobuf/stream/output/smart_contract_service.proto Outdated
Comment thread assets/hip-1056/protobuf/stream/trace/smart_contract_service.proto Outdated
Comment thread assets/hip-1056/protobuf/stream/trace/smart_contract_service.proto Outdated
Comment thread assets/hip-1056/protobuf/stream/trace/smart_contract_service.proto

@Nana-EC Nana-EC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good considerations.
Some questions and clarifications.
@xin-hedera covered my other concerns so interested in the responses to his comments.

In general, preview block streams spec can be broken so no need to preserve the numbers. Also where data can be calculated based on transaction details or retrieved from state we shouldn't be specifying it in the streams.
It's a fine balance though so there may be some cases where duplication/restating is required.

Comment thread HIP/hip-1056.md Outdated
Comment thread HIP/hip-1056.md Outdated
Comment thread HIP/hip-1056.md Outdated
@jsync-swirlds

Copy link
Copy Markdown
Contributor

Quick note. We had a discussion today about forward compatibility and the current hash structure. We are going to propose a small further modification of the Block Stream structure (particularly around how to assign the block items to different subtrees based on field number) soon. That might interact with this PR in some small way.

Signed-off-by: Michael Tinker <michael.tinker@swirldslabs.com>
Signed-off-by: Michael Tinker <michael.tinker@swirldslabs.com>
Signed-off-by: Michael Tinker <michael.tinker@swirldslabs.com>

@Nana-EC Nana-EC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice updates. Thanks for the validations and modifications.
Some questions and suggestions to confirm we've got this final optimization right

Comment thread HIP/hip-1056.md
Comment thread HIP/hip-1056.md
Comment thread HIP/hip-1056.md Outdated
Comment thread HIP/hip-1056.md Outdated
Comment thread assets/hip-1056/protobuf/services/contract_types.proto
Comment thread assets/hip-1056/protobuf/services/contract_types.proto
Comment thread assets/hip-1056/protobuf/services/contract_types.proto
Comment thread assets/hip-1056/protobuf/stream/trace/smart_contract_service.proto Outdated
Signed-off-by: Michael Tinker <michael.tinker@swirldslabs.com>
Signed-off-by: Michael Tinker <michael.tinker@swirldslabs.com>

@Nana-EC Nana-EC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG.
Unblocking, other items can be addressed in follow up PRs.
Let's just make sure we get the proto items right soon so we reduce breaking changes to downstreams consumers

@rbair23 rbair23 changed the title chore: Update Contract Service output and trace specification Update HIP-1056: Contract Service output and trace specification Aug 12, 2025
@rbair23 rbair23 moved this to Draft in HIP Tracker Aug 12, 2025

@xin-hedera xin-hedera left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mgarbs
mgarbs merged commit b397ed6 into hiero-ledger:main Sep 17, 2025
5 of 7 checks passed
@github-project-automation github-project-automation Bot moved this from Draft to Withdrawn in HIP Tracker Sep 17, 2025
@Reccetech Reccetech removed this from HIP Tracker Sep 18, 2025
mgarbs added a commit that referenced this pull request Oct 7, 2025
Signed-off-by: Michael Tinker <michael.tinker@swirldslabs.com>
Co-authored-by: Michael Garber <michael.garber@hashgraph.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants