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

Extrinsic accepted by the node but not included into the block #5313

Open
ERussel opened this issue Aug 11, 2024 · 5 comments
Open

Extrinsic accepted by the node but not included into the block #5313

ERussel opened this issue Aug 11, 2024 · 5 comments
Labels
I10-unconfirmed Issue might be valid, but it's not yet known.

Comments

@ERussel
Copy link

ERussel commented Aug 11, 2024

Summary

I've been trying to debug the issue with the extrinsic submission on Kusama relaychain. Extrinsic weight I am submitting is 679_460_495_220 and the max extrinsic weight from system.BlockWeights::perClass.normal.maxExtrinsic.refTime is 1_479_875_294_000. The node accepts the extrinsic and propagates it to other nodes: I can see it in the pending list if I query author.pendingExtrinsics(). However the extrinsic never included into the block and finally expires due to mortality.

What might be the issue?

What I also noticed it somehow depends on the weights: if I tweak the algorithm it might break after the next runtime upgrade.

Here is an example of the extrinsic. I took it from author.pendingExtrinsics(). It must also include metadataHash - not sure why polkadot.js displays it as null

Extrinsic example
[
  {
    isSigned: true
    method: {
      args: {
        calls: [
          {
            args: {
              class: 10
              to: {
                Id: DCZyhphXsRLcW84G9WmWEXtAA8DKGtVGSFZLJYty8Ajjyfa
              }
              conviction: None
              balance: 0
            }
            method: delegate
            section: convictionVoting
          }
          {
            args: {
              class: 0
              to: {
                Id: DCZyhphXsRLcW84G9WmWEXtAA8DKGtVGSFZLJYty8Ajjyfa
              }
              conviction: None
              balance: 0
            }
            method: delegate
            section: convictionVoting
          }
          {
            args: {
              class: 11
              to: {
                Id: DCZyhphXsRLcW84G9WmWEXtAA8DKGtVGSFZLJYty8Ajjyfa
              }
              conviction: None
              balance: 0
            }
            method: delegate
            section: convictionVoting
          }
          {
            args: {
              class: 12
              to: {
                Id: DCZyhphXsRLcW84G9WmWEXtAA8DKGtVGSFZLJYty8Ajjyfa
              }
              conviction: None
              balance: 0
            }
            method: delegate
            section: convictionVoting
          }
          {
            args: {
              class: 2
              to: {
                Id: DCZyhphXsRLcW84G9WmWEXtAA8DKGtVGSFZLJYty8Ajjyfa
              }
              conviction: None
              balance: 0
            }
            method: delegate
            section: convictionVoting
          }
          {
            args: {
              class: 13
              to: {
                Id: DCZyhphXsRLcW84G9WmWEXtAA8DKGtVGSFZLJYty8Ajjyfa
              }
              conviction: None
              balance: 0
            }
            method: delegate
            section: convictionVoting
          }
          {
            args: {
              class: 14
              to: {
                Id: DCZyhphXsRLcW84G9WmWEXtAA8DKGtVGSFZLJYty8Ajjyfa
              }
              conviction: None
              balance: 0
            }
            method: delegate
            section: convictionVoting
          }
          {
            args: {
              class: 15
              to: {
                Id: DCZyhphXsRLcW84G9WmWEXtAA8DKGtVGSFZLJYty8Ajjyfa
              }
              conviction: None
              balance: 0
            }
            method: delegate
            section: convictionVoting
          }
          {
            args: {
              class: 1
              to: {
                Id: DCZyhphXsRLcW84G9WmWEXtAA8DKGtVGSFZLJYty8Ajjyfa
              }
              conviction: None
              balance: 0
            }
            method: delegate
            section: convictionVoting
          }
        ]
      }
      method: batchAll
      section: utility
    }
    assetId: null
    era: {
      MortalEra: {
        period: 64
        phase: 42
      }
    }
    metadataHash: null
    mode: 1
    nonce: 164
    signature: 0x4e849817f791940c257470343ba89b74a66edcc6bfc60bd613fac430fb56c14453a36d2f154da9a09bb4ee5b7d87a59f34fad9b0614aa12e0251aa5494039481
    signer: {
      Id: FV6MScQExrKL3BPkm28gKZFoV5vTVWMMR79xDqhHGBofcVN
    }
    tip: 0
  }
]
@github-actions github-actions bot added the I10-unconfirmed Issue might be valid, but it's not yet known. label Aug 11, 2024
@ggwpez
Copy link
Member

ggwpez commented Aug 12, 2024

I tried the TX in chopsticks and it works. Maybe some changes in the TX pool? cc @paritytech/sdk-node.

Encoded TX

0x18022414010a00001ba583787c302d270bf87c9febd2fa4b471cc951c73400270789d5193bede10c000000000000000000000000000000000014010000001ba583787c302d270bf87c9febd2fa4b471cc951c73400270789d5193bede10c000000000000000000000000000000000014010b00001ba583787c302d270bf87c9febd2fa4b471cc951c73400270789d5193bede10c000000000000000000000000000000000014010c00001ba583787c302d270bf87c9febd2fa4b471cc951c73400270789d5193bede10c000000000000000000000000000000000014010200001ba583787c302d270bf87c9febd2fa4b471cc951c73400270789d5193bede10c000000000000000000000000000000000014010d00001ba583787c302d270bf87c9febd2fa4b471cc951c73400270789d5193bede10c000000000000000000000000000000000014010e00001ba583787c302d270bf87c9febd2fa4b471cc951c73400270789d5193bede10c000000000000000000000000000000000014010f00001ba583787c302d270bf87c9febd2fa4b471cc951c73400270789d5193bede10c000000000000000000000000000000000014010100001ba583787c302d270bf87c9febd2fa4b471cc951c73400270789d5193bede10c0000000000000000000000000000000000

@skunert
Copy link
Contributor

skunert commented Aug 12, 2024

Not an expert on this topic, but afaik we are grossly overestimating the weight consumption of some of our relay chain inherents.
If we look at the average kusama block, we see ~70% weight consumed by inherents.

Example:
image

So in none of the blocks I looked at there would be enough space for your xt. There are some efforts in progress to reduce the weight declaration, maybe @ordian or @eskimor have more details. I don't think there is a workaround at the moment to get it in with that weight.

@ERussel
Copy link
Author

ERussel commented Aug 12, 2024

@skunert @ggwpez thank you for the answer. It clarifies a lot. Do you know is there a way to fetch percentage of the block that is available for the user extrisics from chain api (storage/constant/runtime api) to not hard code it for each chain?

@sandreim
Copy link
Contributor

Not an expert on this topic, but afaik we are grossly overestimating the weight consumption of some of our relay chain inherents. If we look at the average kusama block, we see ~70% weight consumed by inherents.

#5082 is the fix and will reduce the Kusama para inherent weight to ~50%. Unfortunately I also don't think there is any workaround.

@ordian
Copy link
Member

ordian commented Sep 17, 2024

The weights went down already to around 23% on Polkadot and they are going to go even lower in the next runtime upgrade.
So if this was the cause, it should no longer be the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I10-unconfirmed Issue might be valid, but it's not yet known.
Projects
None yet
Development

No branches or pull requests

5 participants