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

custom dependencies on parentchain runtimes to decode L1 Events #1528

Merged
merged 46 commits into from
Dec 21, 2023

Conversation

brenzi
Copy link
Collaborator

@brenzi brenzi commented Dec 13, 2023

closes #1506

  • move runtime dependencies to ita-parentchain-interface
  • decode events for solo or parachain with separate dependencies
  • decode events for Integritee, TargetA, TargetB with separate dependencies
  • ita_parentchian_interface is now the only crate that depends on runtime implementations

decoding into proper types was too much of a hssle for now. therefore, we just use Default fmt to print events

On Solochains, L1 events now look like this:

[L1Event:IntegriteeSolo] Balances(Withdraw { who:(5E2eQ9D1...), amount: 319638000 })
[L1Event:IntegriteeSolo] EnclaveBridge(ProcessedParentchainBlock { shard: 0x0a41100ba5fd7572206e8b40b74ea5a61780b73946545e4aeede08271f1222cf, block_hash: 0xec6aa3bcf5a2d03d7e8bca0fe037a94caa58e891b301b45763c3d5726082d344, trusted_calls_merkle_root: 0x0000000000000000000000000000000000000000000000000000000000000000, block_number: 1 })

On Parachains, L1 events now look like:

[L1Event:TargetAPara] Treasury(Deposit { value: 2069566 })
[L1Event:IntegriteePara] Treasury(Deposit { value: 1876330 })
[L1Event:IntegriteePara] TransactionPayment(TransactionFeePaid { who:(5E2eQ9D1...), actual_fee: 187633011, tip: 0 })
[L1Event:TargetAPara] TransactionPayment(TransactionFeePaid { who:(5E2eQ9D1...), actual_fee: 206956602, tip: 0 })
[L1Event:IntegriteePara] System(ExtrinsicSuccess { dispatch_info: DispatchInfo { weight: Weight { ref_time: 556799000, proof_size: 3877 }, class: DispatchClass::Normal, pays_fee: Pays::Yes } })
[L1Event:TargetAPara] System(ExtrinsicFailed { dispatch_error: Module(ModuleError { index: 50, error: [5, 0, 0, 0], message: None }), dispatch_info: DispatchInfo { weight: Weight { ref_time: 326159000, proof_size: 3873 }, class: DispatchClass::Normal, pays_fee: Pays::Yes } })
[L1Event:TargetAPara] Balances(Withdraw { who:(5E2eQ9D1...), amount: 206956602 })
....
....
[L1Event:IntegriteePara] Sidechain(FinalizedSidechainBlock { shard: 0x0a41100ba5fd7572206e8b40b74ea5a61780b73946545e4aeede08271f1222cf, block_header_hash: 0x5d341e805bb51544eabd88a5b2e3e791cb971be747c83f52e256a058e224291a, validateer:(5E2eQ9D1...) })
[L1Event:IntegriteePara] EnclaveBridge(ProcessedParentchainBlock { shard: 0x0a41100ba5fd7572206e8b40b74ea5a61780b73946545e4aeede08271f1222cf, block_hash: 0xce5b9563788160c64377e2b11acb844cfa6508a188a1d85e326c0f06b8fe6250, trusted_calls_merkle_root: 0x0000000000000000000000000000000000000000000000000000000000000000, block_number: 10 })

@brenzi brenzi marked this pull request as ready for review December 19, 2023 17:05
@brenzi brenzi added A0-core Affects a core part A2-applibs Affects app-libs, i.e. runtime or stf labels Dec 19, 2023
@brenzi brenzi changed the title Ab/custom parentchain runtime deps flexible dependencies on parentchain runtimes to decode L1 Events Dec 19, 2023
rust-toolchain.toml Outdated Show resolved Hide resolved
@brenzi brenzi requested a review from clangenb December 19, 2023 19:05
@brenzi brenzi changed the title flexible dependencies on parentchain runtimes to decode L1 Events custom dependencies on parentchain runtimes to decode L1 Events Dec 19, 2023
Copy link
Contributor

@clangenb clangenb left a comment

Choose a reason for hiding this comment

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

Nice, only some minor issues, and I am happy about the size of this PR. ;)

Cargo.toml Outdated Show resolved Hide resolved
cli/src/oracle/commands/listen_to_oracle.rs Outdated Show resolved Hide resolved
core-primitives/node-api/api-client-types/src/lib.rs Outdated Show resolved Hide resolved
core/parentchain/parentchain-crate/src/primitives.rs Outdated Show resolved Hide resolved
service/Cargo.toml Outdated Show resolved Hide resolved
@brenzi
Copy link
Collaborator Author

brenzi commented Dec 21, 2023

Hmmm, by now I believe we can probably get rid of runtime deps entirely. Would accelerate the build quite a bit

@brenzi brenzi merged commit b7c72bb into master Dec 21, 2023
71 of 72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A0-core Affects a core part A2-applibs Affects app-libs, i.e. runtime or stf B1-releasenotes C1-low 📌 Does not elevate a release containing this beyond "low priority" E0-breaksnothing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make event subscriptions work with parachain parentchains
2 participants