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

Return encoded extrinsics without padding #2287

Merged
merged 6 commits into from
Nov 28, 2023
Merged

Return encoded extrinsics without padding #2287

merged 6 commits into from
Nov 28, 2023

Conversation

Kailai-Wang
Copy link
Collaborator

@Kailai-Wang Kailai-Wang commented Nov 28, 2023

Context

It should fix the ExtrinsicNotFound error during enclave registration.

With the padded version (post-padded with spaces 0x20) the extrinsic submission would succeed since the decoding goes through even with postpositioned (unused) bytes. However, the substrate-api-client wouldn't find the hash with the prolonged extrinsic that we pass in.

This is also the reason why CI of #2281 failed

fixes #2168
fixes P-151

Related: scs/substrate-api-client#624

@Kailai-Wang Kailai-Wang self-assigned this Nov 28, 2023
@Kailai-Wang
Copy link
Collaborator Author

Reported upstream too: integritee-network/worker#1505

@kziemianek
Copy link
Member

@Kailai-Wang does it fix #2168 ?

@Kailai-Wang Kailai-Wang requested a review from a team November 28, 2023 07:49
@Kailai-Wang
Copy link
Collaborator Author

@Kailai-Wang does it fix #2168 ?

It should.

However, (I was about to say to you) the registration process needs to be reviewed after this one and #2281 get merged: #1133

Copy link

linear bot commented Nov 28, 2023

P-151 Worker always fails to recognize itself as primary validateer

After a startup the worker registers itself in teerex's enclave registry and tries to determine whether he's a primary validateer (the first to be registered) or not but from my experience it looks like it always says it's not.

I've checked the campaign instances logs and it seems the problem existed there too.

[2023-09-27T21:26:23Z ERROR litentry_worker] ExtrinsicFailed ExtrinsicNotFound
[<] Extrinsic got finalized. Hash: None

In short, the implementation could not determine the block at which extrinsic was finalized so it fallbacks to current block. Then based on current block it check if any registered enclave existed before. The answer is yes, thus it pretends as it's not the primary while in fact it is.

if we_are_primary_validateer {
println!("[+] We are the primary validateer");
} else {
println!("[+] We are NOT the primary validateer");
}

Upstream ticket: scs/substrate-api-client#624

Copy link
Collaborator

@BillyWooo BillyWooo left a comment

Choose a reason for hiding this comment

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

Thank you for the explanation. I think it's good to go.

@Kailai-Wang Kailai-Wang merged commit 12a004e into dev Nov 28, 2023
25 of 26 checks passed
@Kailai-Wang Kailai-Wang deleted the trim-padded-xt branch November 28, 2023 19:54
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.

Worker always fails to recognize itself as primary validateer
3 participants