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
Externalize the generation of child records for view calls #9795
Conversation
Signed-off-by: Miroslav Gatsanoga <miroslav.gatsanoga@limechain.tech>
Signed-off-by: Miroslav Gatsanoga <miroslav.gatsanoga@limechain.tech>
Signed-off-by: Miroslav Gatsanoga <miroslav.gatsanoga@limechain.tech>
Signed-off-by: Miroslav Gatsanoga <miroslav.gatsanoga@limechain.tech>
Signed-off-by: Miroslav Gatsanoga <miroslav.gatsanoga@limechain.tech>
Signed-off-by: Miroslav Gatsanoga <miroslav.gatsanoga@limechain.tech>
method no-op Signed-off-by: Miroslav Gatsanoga <miroslav.gatsanoga@limechain.tech>
Signed-off-by: Miroslav Gatsanoga <miroslav.gatsanoga@limechain.tech>
Signed-off-by: Petar Tonev <petar.tonev@limechain.tech>
#9569) Signed-off-by: Stoyan Panayotov <stoyan.panayotov@limechain.tech> Signed-off-by: Petar Tonev <petar.tonev@limechain.tech>
Signed-off-by: Hendrik Ebbers <hendrik.ebbers@web.de> Signed-off-by: Timo Brandstätter <timo@swirldslabs.com> Co-authored-by: Timo Brandstätter <timo@swirldslabs.com> Signed-off-by: Petar Tonev <petar.tonev@limechain.tech>
Signed-off-by: Austin Littley <austin@swirldslabs.com> Signed-off-by: Petar Tonev <petar.tonev@limechain.tech>
Signed-off-by: Michael Tinker <michael.tinker@swirldslabs.com> Signed-off-by: Matt Hess <matt.hess@swirldslabs.com> Co-authored-by: Matt Hess <matt.hess@swirldslabs.com> Signed-off-by: Petar Tonev <petar.tonev@limechain.tech>
… failures. (#9560) Signed-off-by: Ivan Malygin <ivan@swirldslabs.com> Signed-off-by: Petar Tonev <petar.tonev@limechain.tech>
…9600) Signed-off-by: Joseph Sinclair <joseph.sinclair@swirldslabs.com> Signed-off-by: Petar Tonev <petar.tonev@limechain.tech>
Signed-off-by: Jendrik Johannes <jendrik.johannes@gmail.com> Signed-off-by: Petar Tonev <petar.tonev@limechain.tech>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com> Signed-off-by: Petar Tonev <petar.tonev@limechain.tech>
Signed-off-by: Cody Littley <cody@swirldslabs.com> Signed-off-by: Petar Tonev <petar.tonev@limechain.tech>
Signed-off-by: Lazar Petrovic <lpetrovic05@gmail.com> Signed-off-by: Petar Tonev <petar.tonev@limechain.tech>
Signed-off-by: Lev Povolotsky <lev@swirldslabs.com> Signed-off-by: Petar Tonev <petar.tonev@limechain.tech>
…to 09566-fix-token-update-suite
Signed-off-by: Petar Tonev <petar.tonev@limechain.tech>
# Conflicts: # hedera-node/hedera-smart-contract-service-impl/src/main/java/com/hedera/node/app/service/contract/impl/exec/scope/HandleSystemContractOperations.java # hedera-node/hedera-smart-contract-service-impl/src/main/java/com/hedera/node/app/service/contract/impl/exec/scope/QuerySystemContractOperations.java # hedera-node/hedera-smart-contract-service-impl/src/main/java/com/hedera/node/app/service/contract/impl/exec/systemcontracts/hts/AbstractNonRevertibleTokenViewCall.java # hedera-node/hedera-smart-contract-service-impl/src/test/java/com/hedera/node/app/service/contract/impl/test/exec/scope/QuerySystemContractOperationsTest.java
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
hedera-node/hedera-app/src/main/java/com/hedera/node/app/workflows/handle/TokenContextImpl.java
Show resolved
Hide resolved
...ain/java/com/hedera/node/app/workflows/handle/record/SingleTransactionRecordBuilderImpl.java
Show resolved
Hide resolved
...c/main/java/com/hedera/node/app/service/token/impl/handlers/FinalizeParentRecordHandler.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few questions. Not blocked by the questions. Token Service changes LGTM ! Thanks @tinker-michaelj @petreze !
...n/java/com/hedera/node/app/service/contract/impl/exec/systemcontracts/HtsSystemContract.java
Show resolved
Hide resolved
...e/app/service/contract/impl/exec/systemcontracts/hts/AbstractNonRevertibleTokenViewCall.java
Show resolved
Hide resolved
Signed-off-by: Michael Tinker <michael.tinker@swirldslabs.com>
b6bfd63
...src/main/java/com/hedera/node/app/service/contract/impl/exec/systemcontracts/FullResult.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much simpler. Thanks for making the changes. A few minor comments but definitely non blocking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
Signed-off-by: Michael Tinker <michael.tinker@swirldslabs.com>
6bbcf2b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Miroslav Gatsanoga <miroslav.gatsanoga@limechain.tech> Signed-off-by: Petar Tonev <petar.tonev@limechain.tech> Signed-off-by: Stoyan Panayotov <stoyan.panayotov@limechain.tech> Signed-off-by: Hendrik Ebbers <hendrik.ebbers@web.de> Signed-off-by: Timo Brandstätter <timo@swirldslabs.com> Signed-off-by: Austin Littley <austin@swirldslabs.com> Signed-off-by: Michael Tinker <michael.tinker@swirldslabs.com> Signed-off-by: Matt Hess <matt.hess@swirldslabs.com> Signed-off-by: Ivan Malygin <ivan@swirldslabs.com> Signed-off-by: Joseph Sinclair <joseph.sinclair@swirldslabs.com> Signed-off-by: Jendrik Johannes <jendrik.johannes@gmail.com> Signed-off-by: Kelly Greco <kelly@swirldslabs.com> Signed-off-by: Cody Littley <cody@swirldslabs.com> Signed-off-by: Lazar Petrovic <lpetrovic05@gmail.com> Signed-off-by: Lev Povolotsky <lev@swirldslabs.com> Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech> Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@swirldslabs.com> Co-authored-by: Miroslav Gatsanoga <miroslav.gatsanoga@limechain.tech> Co-authored-by: Stoyan Panayotov <stoyan.panayotov@limechain.tech> Co-authored-by: Hendrik Ebbers <hendrik.ebbers@web.de> Co-authored-by: Timo Brandstätter <timo@swirldslabs.com> Co-authored-by: Austin Littley <102969658+alittley@users.noreply.github.com> Co-authored-by: Michael Tinker <michael.tinker@swirldslabs.com> Co-authored-by: Matt Hess <matt.hess@swirldslabs.com> Co-authored-by: Ivan Malygin <ivan@swirldslabs.com> Co-authored-by: Joseph Sinclair <121976561+jsync-swirlds@users.noreply.github.com> Co-authored-by: Jendrik Johannes <jendrik.johannes@gmail.com> Co-authored-by: Kelly Greco <82919061+poulok@users.noreply.github.com> Co-authored-by: Cody Littley <56973212+cody-littley@users.noreply.github.com> Co-authored-by: Lazar Petrovic <lpetrovic05@gmail.com> Co-authored-by: Lev Povolotsky <16233475+povolev15@users.noreply.github.com> Co-authored-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech> Co-authored-by: Neeharika-Sompalli <neeharika.sompalli@swirldslabs.com> Co-authored-by: Neeharika Sompalli <52669918+Neeharika-Sompalli@users.noreply.github.com> Signed-off-by: Nick Poorman <nick@swirldslabs.com>
Description:
Reduces code duplication and fixes several remaining details involved in externalizing child
ContractCallResult
's.1️⃣ In
hedera-app
,ChildRecordFinalizer
to set transfer lists in the records of dispatched transactions.ExchangeRateSet
from all child record receipts (not just preceding).newTotalSupply
and minted serial numbers (we need this to encode output from burn/mint HTS system contract calls).2️⃣ In
contract-service
,SystemContractOperations#externalizePreemptedDispatch()
method to letHtsCall
implementations externalize dispatches that were pre-empted for reasons not enforced by handlers (e.g. to prevent transfers to system accounts).isViewCall
flag toFullResult
and externalizing results inHtsSystemContract
.ContractCallRecordBuilder
toFullResult
so thatHtsCall
implementations can directly return their usedContractCallRecordBuilder
.HtsSystemContract
to add the implied syntheticContractCallResult
to such record builders.FullResult
a top-level record for readability.HtsCall.allowsStaticFrame()
and reverts inHtsSystemContract
when the frame is static and this method returns false.GrantRevokeKycTranslator
to match mono-service behavior of leavingINVALID_SIGNATURE
response code untouched (instead of converting toINVALID_FULL_PREFIX_SIGNATURE_FOR_PRECOMPILE
).int64 responseCode
).ClassicTransfersCall
to:transferFrom()
andtransferFromNFT()
.tokenTransferList
's with the sameTokenID
.3️⃣ In
token-service
,FinalizeParentRecordHandler
to deduct child token transfers from the top-level record (unlike in mono-service these need to be explicitly deducted from parent).AdjustFungibleTokenChangesStep
to match mono-service behavior.ChildFinalizeContext
as the base interface ofFinalizeContext
, with just what is needed to finalize a single child record.4️⃣ In
test-clients
,CryptoTransferHTSSuite
ACCEPTED_MONO_GAS_CALCULATION_DIFFERENCE
snapshot matching mode to allow mod-service gas calculations to differ in edge cases.@HapiTest
s.➡️ Next steps:
DispatchForResponseCodeHtsCall
(can always just useContractCallRecordBuilder
).HtsCall
implementations withDispatchForResponseCodeHtsCall
instances where custom behavior is achieved viaFailureCustomizer
andOutputFn
instead of standaloneHtsCall
implementations.blockValues
,value
,isStaticCall
fromHtsCallAttempt
(these are now available on theMessageFrame
passed toexecute()
).Related issue(s):
calculateFees
in ContractCallHandler #8920Checklist