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

Polkadot update v0.9.42 #1337

Merged
merged 38 commits into from
Aug 1, 2023
Merged

Polkadot update v0.9.42 #1337

merged 38 commits into from
Aug 1, 2023

Conversation

OverOrion
Copy link
Contributor

@OverOrion OverOrion commented May 31, 2023

@OverOrion OverOrion force-pushed the szp/polkadot-v0.9.42 branch 3 times, most recently from 7efc53d to 598e7d8 Compare June 2, 2023 12:36
@OverOrion OverOrion added A0-core Affects a core part B0-silent Item should not be mentioned in any change logs. (e.g. documentation updates) C1-low 📌 Does not elevate a release containing this beyond "low priority" E0-breaksnothing labels Jun 8, 2023
@OverOrion OverOrion marked this pull request as ready for review June 8, 2023 13:54
@OverOrion OverOrion changed the title [WIP] Polkadot update v0.9.42 Polkadot update v0.9.42 Jun 8, 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.

Looks actually good to me, I don't know how the CI error can occur yet.

cli/src/base_cli/mod.rs Outdated Show resolved Hide resolved
cli/src/benchmark/mod.rs Outdated Show resolved Hide resolved
core-primitives/extrinsics-factory/Cargo.toml Outdated Show resolved Hide resolved
app-libs/sgx-runtime/src/lib.rs Outdated Show resolved Hide resolved
@brenzi
Copy link
Collaborator

brenzi commented Jul 18, 2023

I see these errors in the log, seem to be new:
offchain-worker-demo-indirect-invocation-demo-indirect-invocation-1 | [2023-07-17T15:05:54Z WARN substrate_api_client::rpc::ws_client] Expected subscription, but received an id response instead: Object {"id": String("1"), "jsonrpc": String("2.0"), "result": String("r1pAt7znUzbHt4Lp")}

see M6 offchain test

@brenzi
Copy link
Collaborator

brenzi commented Jul 19, 2023

started testing manually: locally with SW mode and skip-ra: https://hackmd.io/@brenzi5/HJ8Y2Sr5n

  • teeracle works as expected
  • sidechain single validateer
  • sidechain 2 validateers

@brenzi
Copy link
Collaborator

brenzi commented Jul 19, 2023

seems like our integritee-node is notcompatible with rpc behavior of api-client polkadot-0.9.42-tag-1.10
scs/substrate-api-client#620 (comment)

therefore, integritee-service thinks that extrinsics fail when they don't and block hashes are wrong (wrong hash is fixed with next commit)

not sure if this could help:
#1266

"enclave count is {} for previous block 0x{:?}",
enclave_count_of_previous_block,
register_enclave_xt_header.parent_hash()
);
Ok(enclave_count_of_previous_block == 0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I really don't get the logic of this. It's here for a while already: why so complicated?
why check that enclave count was zero in the previous block when we can check that it is 1 in the current block?
I didn't touch it beyond logging because we'll kick that out anyway and replace it with per-shard ShardStatus logic

Copy link
Contributor

Choose a reason for hiding this comment

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

I have no idea actually.

@brenzi
Copy link
Collaborator

brenzi commented Jul 20, 2023

I reproduced sending a transfer extrinsic with an api-client example and until_success works as expected (apart from the warning we observe as well.)

the successful jsnrpc log looks like this:

[2023-07-20T15:03:15Z INFO  substrate_api_client::rpc::ws_client] sending request: {"id":"1","jsonrpc":"2.0","method":"author_submitAndWatchExtrinsic","params":["0x3d028400d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d01421a7e29f0b5f430034d0e909a9e8a8073fcfb71888f721065e8832034259245b488cdd2adc6ae538a2f13a82f49e8a3208e549a9d3bf1734c013065be683a86001c000a00008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48070010a5d4e8"]}
[2023-07-20T15:03:15Z INFO  substrate_api_client::rpc::ws_client] got on_subscription_msg {"jsonrpc":"2.0","result":"6soqlODDXRt58lf7","id":"1"}
[2023-07-20T15:03:15Z WARN  substrate_api_client::rpc::ws_client] Expected subscription, but received an id response instead: Object {"id": String("1"), "jsonrpc": String("2.0"), "result": String("6soqlODDXRt58lf7")}
[2023-07-20T15:03:15Z INFO  substrate_api_client::rpc::ws_client] got on_subscription_msg {"jsonrpc":"2.0","method":"author_extrinsicUpdate","params":{"subscription":"6soqlODDXRt58lf7","result":"ready"}}
[2023-07-20T15:03:24Z INFO  substrate_api_client::rpc::ws_client] got on_subscription_msg {"jsonrpc":"2.0","method":"author_extrinsicUpdate","params":{"subscription":"6soqlODDXRt58lf7","result":{"inBlock":"0xe8a977d95d199d8ed87fc7b14c41e05fb1faaaee2ba9feb0a324796a039dc90e"}}}
[2023-07-20T15:03:48Z INFO  substrate_api_client::rpc::ws_client] got on_subscription_msg {"jsonrpc":"2.0","method":"author_extrinsicUpdate","params":{"subscription":"6soqlODDXRt58lf7","result":{"finalized":"0xe8a977d95d199d8ed87fc7b14c41e05fb1faaaee2ba9feb0a324796a039dc90e"}}}
[2023-07-20T15:03:48Z INFO  ws] Queuing connection to ws://127.0.0.1:9944/
[2023-07-20T15:03:48Z INFO  substrate_api_client::rpc::ws_client] sending request: {"id":"1","jsonrpc":"2.0","method":"chain_getBlock","params":["0xe8a977d95d199d8ed87fc7b14c41e05fb1faaaee2ba9feb0a324796a039dc90e"]}
[2023-07-20T15:03:48Z INFO  substrate_api_client::rpc::ws_client] Got get_request_msg {"jsonrpc":"2.0","result":{"block":{"header":{"parentHash":"0x5d7003f5fe62ec7ba76bfd5f7bbb8b4824a72e760dd47ac0639b4a998e21f89f","number":"0x2f8","stateRoot":"0x1021a40886c6514173d2776d64c4c9d313ed59e69cecf3262a4aae133aff8730","extrinsicsRoot":"0x2d337d19d5ef693f5954aedca5b586e2344db208e6e0ba832f03e153fc59532a","digest":{"logs":["0x06617572612065c6640800000000","0x056175726101010cbfeda0e25e143b808ea3014fe117799e53dd7af22c0034f92a611ec4404d526e776617e7cec845b4ca2833e4bd86e3d6c84fd48db86b3ed17af29f9c3dc081"]}},"extrinsics":["0x280403000b61bed3738901","0x3d028400d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d01421a7e29f0b5f430034d0e909a9e8a8073fcfb71888f721065e8832034259245b488cdd2adc6ae538a2f13a82f49e8a3208e549a9d3bf1734c013065be683a86001c000a00008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48070010a5d4e8"]},"justifications":null},"id":"1"}
[2023-07-20T15:03:49Z INFO  ws] Queuing connection to ws://127.0.0.1:9944/
[2023-07-20T15:03:49Z INFO  substrate_api_client::rpc::ws_client] sending request: {"id":"1","jsonrpc":"2.0","method":"state_getStorage","params":["0x26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7","0xe8a977d95d199d8ed87fc7b14c41e05fb1faaaee2ba9feb0a324796a039dc90e"]}
[2023-07-20T15:03:49Z INFO  substrate_api_client::rpc::ws_client] Got get_request_msg {"jsonrpc":"2.0","result":"0x1c00000000000000e27c01510002000000010000000a08d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27db0806a0f0000000000000000000000000000010000000a02d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a480010a5d4e800000000000000000000000000010000000a076d6f646c70792f747273727900000000000000000000000000000000000000000c7727000000000000000000000000000000010000001e060c7727000000000000000000000000000000010000000b00d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27db0806a0f00000000000000000000000000000000000000000000000000000000000001000000000082aef55800000000","id":"1"}
[+] Extrinsic got included. block hash: Some(0xe8a977d95d199d8ed87fc7b14c41e05fb1faaaee2ba9feb0a324796a039dc90e)
[+] Extrinsic got included. extrinsic hash: 0xb0117124699f03cd63eeb69fed470fe589803054d4523d169e28015e2ad338c9
[+] Extrinsic got included. status: Finalized(0xe8a977d95d199d8ed87fc7b14c41e05fb1faaaee2ba9feb0a324796a039dc90e)

I will now gather the same type of log for the failing case here

@brenzi
Copy link
Collaborator

brenzi commented Jul 20, 2023

ok. our issue was scs/substrate-api-client#624
workaround is to not verify extrinsic success in main thread
let's see if there are others....

@brenzi
Copy link
Collaborator

brenzi commented Jul 20, 2023

back to square one:

  • first validateer produces blocks
  • second validateer knows he's not primary and tries to sync. but won't accept blocks
  • sidechain.confirmImportedSidechainBlock is never called
  • sidechainWorkerForShard stays empty (local testing)
[2023-07-20T19:15:40Z INFO  its_consensus_common::peer_block_sync] Fetched 119 blocks from peer to import
[2023-07-20T19:15:40Z DEBUG its_consensus_common::block_import] Attempting to import sidechain block (number: 24, hash: 0xea21f835a72b5e369db3e50ddd8a23fa4889e6e5aa63ec3c1fab99098eda8e34, parentchain hash: 0x1074ecab5fd26c2bf223110a86012709262f60c67823b344ba26aeb51f1008ab)
[2023-07-20T19:15:41Z INFO  its_consensus_common::block_import] Applying state diff for block 24 of size 219 bytes
[2023-07-20T19:15:41Z ERROR its_consensus_common::peer_block_sync] Failed to import sidechain block that was fetched from peer: Other(InvalidAprioriHash)
[2023-07-20T19:15:41Z ERROR enclave_runtime::error] Returning error Consensus(Other(InvalidAprioriHash)) as sgx unexpected.
[2023-07-20T19:15:41Z ERROR integritee_service::sidechain_setup] Sgx(SGX_ERROR_UNEXPECTED)

@brenzi
Copy link
Collaborator

brenzi commented Jul 21, 2023

Hmm, very similar to #1366 which shall be fixed by #1370.

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.

Cool, I have revisited the PR, and I think it is ready when the CI says so! 🥳

cli/src/base_cli/commands/transfer.rs Show resolved Hide resolved
cli/src/trusted_operation.rs Show resolved Hide resolved
docker/entrypoint.sh Show resolved Hide resolved
"enclave count is {} for previous block 0x{:?}",
enclave_count_of_previous_block,
register_enclave_xt_header.parent_hash()
);
Ok(enclave_count_of_previous_block == 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

I have no idea actually.

@clangenb
Copy link
Contributor

clangenb commented Aug 1, 2023

I will merge it, as the instability has been noted before and does not have to do with this PR, see #1403

@clangenb clangenb merged commit d1b8cbe into master Aug 1, 2023
19 of 21 checks passed
@clangenb clangenb deleted the szp/polkadot-v0.9.42 branch August 14, 2023 14:49
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 B0-silent Item should not be mentioned in any change logs. (e.g. documentation updates) 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.

polkadot-v0.9.42 update bricks local keystore key retrieval upgrade dependencies to polkadot-0.9.42
3 participants