-
Notifications
You must be signed in to change notification settings - Fork 46
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
Update call status to InSidechainBlock
only after block import
#676
Conversation
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.
Looks good to me. Some minor change request regarding code duplication
echo "* Waiting 2 seconds" | ||
sleep 2 | ||
echo "" | ||
|
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.
So the client call (i.e. listener) blocks until the sidechain block is imported (meaning state is updated)? That ensures when we continue that a getter will return the correct state?
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.
Yes, currently the cli waits until InSidechainBlock
by default. Ideally, we will introduce the option to choose until which state we want to listen to, just like in the susbtrate-api-client. But that's an open issue: #207
let signed_top_hashes = block.signed_top_hashes(); | ||
let executed_operations = signed_top_hashes | ||
.iter() | ||
.map(|hash| { | ||
// Only successfully executed operations are included in a block. | ||
ExecutedOperation::success(*hash, TrustedOperationOrHash::Hash(*hash), Vec::new()) | ||
}) | ||
.collect(); |
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.
In case we really need this elaborate implementation in a mock, we should probably extract a common utility method to get the executed operations from a block?
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.
I removed the extra logic completely from on_block_imported. It's now only updating the call statuses of the pool.
|
||
fn on_block_imported(&self, _block: &SignedSidechainBlock::Block) { | ||
// Do nothing for now | ||
// FIXME: We should include unit tests to see if pool is notified about block import |
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.
I added a FIXME here, because I think adding unit test doesn't make sense right now.. in case we decide to update the top pool to call pool.
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 now 👍
* Add a local-setup config to the tutorial (integritee book) (integritee-network#666) * Update call status to `InSidechainBlock` only after block import (integritee-network#676) * rename on_block_created to on_block_imported * update tx status only after block import * fix clippy * fix cargo test * remove waiting time from demos * readd removed comments * udpate comments * extract call removal logic from on_block_imported * Bump substrate to commit f5f286db0da9... (integritee-network#669) * Bump substrate Bump substrate to commit 8df8d908c4d77a8dd19751784b6aca62159ddda8 Remove dependencies of scale-info 1.0.0 and parity-scale-codec 2.3.1 Upgrade substrate to commit f5f286d... substrate fix for : sp-core's full_crypto feature flag breaks no_std builds * frame-metadata from crates.io * Update CI to use updated node Co-authored-by: echevrier <[email protected]> * Dockerize (integritee-network#668) * Dockerize the binaries integritee-network#579 * Add tags to run as well integritee-network#579 * Fix running binary in docker integritee-network#579 * Add more files to docker integritee-network#579 * Add conditional runs * Add +x earlier * Rename docker-service to integritee-demo-validateer. Fixes integritee-network#579 * Lift clap to version 3.16 and move stf cli to cli crate. (integritee-network#679) * Lift clap to version 3.16 and move stf cli to cli crate. * Adapt demo script parameters * Add cli examples to README.md * update comment descriptions Co-authored-by: Gaudenz Kessler <[email protected]> * Refactor global components and initialization process (integritee-network#677) * Consistently (re-)use the component container * RPC server is initialized before registering on the parentchain * Fix issue with sidechain block import when latest parentchain block is already too new Closes integritee-network#545 integritee-network#600 integritee-network#684 integritee-network#683 * create alive service to deterine that the service is up, running and registered (integritee-network#697) * create alive service * replace alive with initialized Co-authored-by: Gaudenz Kessler <[email protected]> * Add port config for the untrusted http server for `is_initialized` (integritee-network#700) * rename wrong `signing_key` function name to `state_key` (integritee-network#704) * Move top pool and top pool author crates to core primitives (integritee-network#705) * Introduce state snapshot history (integritee-network#698) Closes integritee-network#688 * Add header to sidechain block (integritee-network#699) Closes integritee-network#686 Co-authored-by: Gaudenz Kessler <[email protected]> * introduce layer for indirection for sidechainblock (integritee-network#716) Closes integritee-network#710 Co-authored-by: Gaudenz Kessler <[email protected]> Co-authored-by: Felix Müller <[email protected]> * Persist web-socket connections (integritee-network#718) Complete overhaul of the trusted web-socket server: * using MIO to serve concurrent connections * Server keeps connections open until a client requests a close * Changed our clients to match this pattern * Upgrade to polkadot v0.9.19 (integritee-network#720) * Bump substrate to polkadot-v0.9.19 Bump RUNTIME_SPEC_VERSION to 9 Set substrate-api-client to polkadot-v0.9.19 Set integritee-node to polkadot-v0.9.19 Set integritee-node to master * Cargo update + reabse * Update github actions Co-authored-by: echevrier <[email protected]> * fix some cargo.tomls * fix cargo.lock * remove game engine * update teerex module * fix itp-registry-storage * cargo update * resinsert game engine * some further clean up * update teaclave * add ajuna commands * cargo update * carog update * update ajuna cli * fix some thins * Signed sidechain block * fix shard_id getter * fix load_initialized * fix sgx externalities import * fix compilation issues * remove patches and cargo update * update demo docu * add bin folder to docu * remove hard coded ports. Not necesasry * add ./ * update pallet verions * make tests compile again * fix import in sgx mode * merge from upstream number two.. remove itp storage verifier * cargo fmt * fix tests * update doc once again * fix script and queue game * cargo update + some code clean up Co-authored-by: Felix Müller <[email protected]> Co-authored-by: echevrier <[email protected]> Co-authored-by: echevrier <[email protected]> Co-authored-by: mosonyi <[email protected]> Co-authored-by: gaudenzkessler <[email protected]> Co-authored-by: Gaudenz Kessler <[email protected]> Co-authored-by: Felix Müller <[email protected]>
Call status
InSidechainblock
is now not updated any more upon block creation, but only after block import. This change is a preparatory step for benchmarking and removes the need for extra waiting time in the demos before state querying.closes #672