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

Add option in the ContractCallContext to hold the contract that is currently being deployed #9798

Open
Tracked by #8828
bilyana-gospodinova opened this issue Nov 22, 2024 · 0 comments
Assignees
Labels
enhancement Type: New feature web3 Area: Web3 API

Comments

@bilyana-gospodinova
Copy link
Contributor

bilyana-gospodinova commented Nov 22, 2024

Problem

During the implementation of the reusable services integration it turns out that now the contracts are deployed in 2 steps:

  1. The initcode is uploaded and saved as a file using a FileCreateTransactionBody.
  2. The returned file id from step 1 is then passed to a 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.

Solution

Add 2 new fields in the ContractCallContext that preserve the file id and the contract's bytecode. If they are available when we call FileReadableKVState#readFromDataSource, return them with priority.

Alternatives

No response

@bilyana-gospodinova bilyana-gospodinova added enhancement Type: New feature web3 Area: Web3 API labels Nov 22, 2024
@bilyana-gospodinova bilyana-gospodinova self-assigned this Nov 22, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Mirror Node Nov 22, 2024
@bilyana-gospodinova bilyana-gospodinova moved this from 📋 Backlog to 👀 In review in Mirror Node Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Type: New feature web3 Area: Web3 API
Projects
Status: 👀 In review
Development

No branches or pull requests

1 participant