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

Hubble 526 protocol22 changes #283

Merged
merged 8 commits into from
Nov 5, 2024
Merged

Conversation

chowbao
Copy link
Contributor

@chowbao chowbao commented Sep 16, 2024

PR Checklist

PR Structure

  • This PR has reasonably narrow scope (if not, break it down into smaller PRs).
  • This PR avoids mixing refactoring changes with feature changes (split into two PRs
    otherwise).
  • This PR's title starts with the jira ticket associated with the PR.

Thoroughness

  • This PR adds tests for the most critical parts of the new functionality or fixes.
  • I've updated the README with the added features, breaking changes, new instructions on how to use the repository. I updated the description of the fuction with the changes that were made.

Release planning

  • I've decided if this PR requires a new major/minor/patch version accordingly to
    semver, and I've changed the name of the BRANCH to release/_ , feature/_ or patch/* .

What

Add support for Protocol 22 changes

  • Largely this is supporting the new constructor params in the form of a new createContractV2 from InovkeHostFunction

  • The relevant bls changes are only updating the ContractCostType enum with bls changes. This is automatically taken care of because stellar-etl config_settings handles ContractCost as map/dict-like {type: value}. If needed this can be made more user friendly with dbt transformations into a flattened table

  • CAP60 may be moved out of P22

Why

To support P22

Known limitations

  • Need to update/add tests
  • Keep as draft until P22 core image running in testnet; Theoretically because of backwards compatibility this can be merged and run in prod but it would be nice to keep them separate until P22 changes are fully set in stone

}
case xdr.HostFunctionTypeHostFunctionTypeUploadContractWasm:
details["type"] = "upload_wasm"
transactionEnvelope := getTransactionV1Envelope(operation.transaction.Envelope)
details["ledger_key_hash"] = ledgerKeyHashFromTxEnvelope(transactionEnvelope)
details["contract_code_hash"] = contractCodeHashFromTxEnvelope(transactionEnvelope)
case xdr.HostFunctionTypeHostFunctionTypeCreateContractV2:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Operation cases are duplicated due to how the original stellar-etl was written

Copy link
Contributor

@sydneynotthecity sydneynotthecity left a comment

Choose a reason for hiding this comment

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

To-do: fix unit tests and looks good 🤷‍♀️

Comment on lines +1680 to +1681
// This will initially be handled the same as InvokeContractParams until a different
// model is found necessary.
Copy link
Contributor

Choose a reason for hiding this comment

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

when you say "until a different model is found necessary" do you mean if we need to update the schema/data model? Or is there a possibility core will change how they present this data?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah my assumption right now is that because these constructorArgs are also []ScVal that they can be handled the same way as the invoke params. But it is possible that core designed constructorArgs to be different but there were no existing examples at the time of writing 😅

So the comment is more like "hey these two things look similar and currently process similarly but that doesn't mean they will look and process similarly in the future until p23 is released and made permanent"

internal/transform/operation.go Show resolved Hide resolved
@chowbao chowbao marked this pull request as ready for review October 29, 2024 20:16
@chowbao chowbao requested a review from a team as a code owner October 29, 2024 20:16
Copy link
Contributor

@sydneynotthecity sydneynotthecity left a comment

Choose a reason for hiding this comment

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

LGTM

Is now the right time to throw a deprecation warning that we plan to drop stellar-core support from ETL directly?

Copy link
Contributor

Choose a reason for hiding this comment

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

nice

@chowbao
Copy link
Contributor Author

chowbao commented Oct 30, 2024

LGTM

Is now the right time to throw a deprecation warning that we plan to drop stellar-core support from ETL directly?

That's a good idea. I'll throw in the deprecation warning

Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
golang/github.com/stellar/[email protected] environment, filesystem, network, shell, unsafe 0 14.3 MB

🚮 Removed packages: golang/github.com/stellar/[email protected]

View full report↗︎

@chowbao chowbao merged commit 204d343 into master Nov 5, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants