-
Notifications
You must be signed in to change notification settings - Fork 112
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
Add file id and init bytecode in ContractCallContext
#9799
Add file id and init bytecode in ContractCallContext
#9799
Conversation
Signed-off-by: Bilyana Gospodinova <bilyana.gospodinova14@gmail.com>
Signed-off-by: Bilyana Gospodinova <bilyana.gospodinova14@gmail.com>
Signed-off-by: Bilyana Gospodinova <bilyana.gospodinova14@gmail.com>
Signed-off-by: Bilyana Gospodinova <bilyana.gospodinova14@gmail.com>
Signed-off-by: Bilyana Gospodinova <bilyana.gospodinova14@gmail.com>
ContractCallContext
Signed-off-by: Bilyana Gospodinova <bilyana.gospodinova14@gmail.com>
Signed-off-by: Bilyana Gospodinova <bilyana.gospodinova14@gmail.com>
Signed-off-by: Bilyana Gospodinova <bilyana.gospodinova14@gmail.com>
hedera-mirror-web3/src/main/java/com/hedera/mirror/web3/common/ContractCallContext.java
Outdated
Show resolved
Hide resolved
hedera-mirror-web3/src/main/java/com/hedera/mirror/web3/state/FileReadableKVState.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Bilyana Gospodinova <bilyana.gospodinova14@gmail.com>
…798-enhance-FileReadableKVState-to-fetch-contract-from-ContractCallContext
Signed-off-by: Bilyana Gospodinova <bilyana.gospodinova14@gmail.com>
…te-and-subcomponents
Signed-off-by: Bilyana Gospodinova <bilyana.gospodinova14@gmail.com>
Signed-off-by: Bilyana Gospodinova <bilyana.gospodinova14@gmail.com>
Signed-off-by: Bilyana Gospodinova <bilyana.gospodinova14@gmail.com>
hedera-mirror-web3/src/main/java/com/hedera/mirror/web3/common/ContractCallContext.java
Outdated
Show resolved
Hide resolved
The base branch was changed.
…dableKVState-to-fetch-contract-from-ContractCallContext
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
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9799 +/- ##
=========================================
Coverage 92.24% 92.24%
- Complexity 7830 7832 +2
=========================================
Files 953 953
Lines 32759 32766 +7
Branches 4142 4143 +1
=========================================
+ Hits 30217 30225 +8
Misses 1568 1568
+ Partials 974 973 -1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Bilyana Gospodinova <bilyana.gospodinova14@gmail.com>
Quality Gate passedIssues Measures |
Description:
During the implementation of the reusable services integration it turns out that now the contracts are deployed in 2 steps:
FileCreateTransactionBody
.ContractCreateTransactionBody
.Each step performs a separate transaction.
For step 2 even if we pass the correct file id, since the mirror node data is readonly, the
FileReadableKVState
is not able to populate the contract's bytecode from the DB since it was never explicitly persisted in the DB.This PR add a new field in the
ContractCallContext
that preserve the file id and the contract's bytecode. The new field is called "file". If it is available when we callFileReadableKVState#readFromDataSource
then we return the file from the context with priority.This field might need to be cleared up at some point but this will probably added later when the correct place is found during testing.
Fixes #9798