Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poll smart-contract transaction logs directly from the REST Mirror Network #76

Open
3Nigma opened this issue Apr 28, 2022 · 1 comment
Assignees
Labels
contracts LiveContract/Smart contract related enhancement New feature or request heavy work Heavy work is expected for this
Milestone

Comments

@3Nigma
Copy link
Contributor

3Nigma commented Apr 28, 2022

Currently, we issue a TransactionRecordQuery request if we want smart-contract execution logs following a ContractExecuteTransaction call. For ContractCallQuery there is no such requirement since, by design, the ContractCallQuery response (which is a ContractFunctionResult) contains those logs.

Such a transaction is costly but there is a way around this: we poll for the logs from the mirror-node via GET-ing on /api/v1/contract/{contractId}/results/logs.

Now this is admittedly a burdensome strategy since it will put load on the mirror-node, yet since other libraries are doing it (eg. hethers), we might as well go down this path for cost-efficiency. Maybe we have this polling enabled via a flag? That's worth thinking about.

@3Nigma 3Nigma added enhancement New feature or request heavy work Heavy work is expected for this contracts LiveContract/Smart contract related labels Apr 28, 2022
@3Nigma 3Nigma added this to the 0.8.0 milestone Apr 28, 2022
@3Nigma 3Nigma modified the milestones: Back-burner, 0.8.1 Oct 14, 2022
@3Nigma
Copy link
Contributor Author

3Nigma commented Oct 14, 2022

TransactionReceipts can also be sufficiently reconstructed from rest-mirror fetched data so we should include them as well.

A new StratoContext - network config parameter shall be introduced, HEDERAS_REST_MIRROR_URL, that will be used if HEDERAS_NETWORK is customnet and the default value of http://127.0.0.1:5551 will not suffice.

Following this transition to rest-mirror data, the following session parameters will be no longer needed and subsequently removed:

  • HEDERAS_DEFAULT_EMIT_CONSTRUCTOR_LOGS (and other network variants)
  • HEDERAS_DEFAULT_EMIT_LIVE_CONTRACTS_RECEIPTS (+ specific network variants)
  • HEDERAS_DEFAULT_CONTRACT_REQUESTS_RETURN_ONLY_RECEIPTS (+ variants)

@3Nigma 3Nigma self-assigned this Oct 14, 2022
@3Nigma 3Nigma changed the title Poll smart-contract transaction logs directly from Mirror Node Poll smart-contract transaction logs directly from the REST Mirror Network Oct 15, 2022
3Nigma added a commit that referenced this issue Oct 17, 2022
…rings around HederaNetwork/StratoContext class.
@3Nigma 3Nigma modified the milestones: 0.8.1, 0.8.2 Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contracts LiveContract/Smart contract related enhancement New feature or request heavy work Heavy work is expected for this
Projects
None yet
Development

No branches or pull requests

1 participant