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

feat: Wrap modularized code in transactionExecutionService #9943

Merged

Conversation

kselveliev
Copy link
Contributor

@kselveliev kselveliev commented Dec 12, 2024

Description:

This PR wraps modularized execution and logic into it's own standalone TransactionExecutionService.
Doing this the adaptation of the OpcodeServiceTest arguments and result captors becomes incredibly easy.
Also added opcodeTracer when the call is coming from an opcode call.

Main changes:
Added TransactionExecutionService class
Which contains the new modularized execution logic in itself. The code is moved from ContractCallService into TransactionExecutionService with the only addition of the opcodeTracer if the opcode tracer options are set.

AbstractContractCallServiceOpcodeTracerTest - now check based on the modularized feature flag to capture arguments and result either from mirrorEvmTxProcessor.execute or transactionExecutionService.execute

TransactionExecutionServiceTest - adds coverage for the newly created class.

Fixes #9830

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

…codeTracer

Signed-off-by: Kristiyan Selveliev <kristiyan.selveliev@limechain.tech>
@kselveliev kselveliev self-assigned this Dec 12, 2024
@kselveliev kselveliev added web3 Area: Web3 API enhancement Type: New feature labels Dec 12, 2024
@kselveliev kselveliev marked this pull request as ready for review December 12, 2024 12:06
@kselveliev kselveliev requested a review from a team as a code owner December 12, 2024 12:06
@kselveliev kselveliev changed the title feat: Wrap modularized code in transactionExecutionService and add op… feat: Wrap modularized code in transactionExecutionService Dec 12, 2024
@@ -2,6 +2,7 @@ hedera:
mirror:
web3:
evm:
modularizedServices: false
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not needed as by the default the value is false.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, comment addressed

Signed-off-by: Kristiyan Selveliev <kristiyan.selveliev@limechain.tech>
…e-service

Signed-off-by: Kristiyan Selveliev <kristiyan.selveliev@limechain.tech>
Copy link
Contributor

@bilyana-gospodinova bilyana-gospodinova left a comment

Choose a reason for hiding this comment

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

LGTM

if (isContractCreate) {
// Upload the init bytecode
transactionBody = buildFileCreateTransactionBody(params, maxLifetime);
var uploadReceipt = executor.execute(transactionBody, Instant.EPOCH);
Copy link
Contributor

@IvanKavaldzhiev IvanKavaldzhiev Dec 16, 2024

Choose a reason for hiding this comment

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

Do we need this call? What if we use the next available FileID in the mirror node, as a value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can be addressed in the base PR since this pr is just copy paste the code from the modularized property pr

Signed-off-by: Kristiyan Selveliev <kristiyan.selveliev@limechain.tech>
…e-service

Signed-off-by: Kristiyan Selveliev <kristiyan.selveliev@limechain.tech>
@kselveliev
Copy link
Contributor Author

Merging any other changes will be addressed in the #9927 PR

@kselveliev kselveliev merged commit fb69f19 into 09261-modularized-services-flag Dec 16, 2024
4 checks passed
@kselveliev kselveliev deleted the 09830-adapt-opcode-service branch December 16, 2024 16:34
@steven-sheehy steven-sheehy added this to the 0.121.0 milestone Jan 6, 2025
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
None yet
Development

Successfully merging this pull request may close these issues.

4 participants