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

Parachain ValidationFunctionApplied different relay block than Relay #962

Open
crystalin opened this issue Jul 9, 2021 · 1 comment
Open
Labels
I2-bug The node fails to follow expected behavior.

Comments

@crystalin
Copy link

crystalin commented Jul 9, 2021

Moonriver (para id 2023) did a runtime upgrade, Friday around 2:45am UTC
The runtime was planned to be applied 1 hour later.

When the time came, the runtime upgrade was applied on the parachain.
The collators started to produce blocks with the new runtime successfully (no error in the logs neither), but the relay validator refused them (Digest item must match that calculated.).
The parachain became stalled at that point with no possibility of recovery.

After looking at the paras state, we observed that the relay paras.futureCodeUpgrades was planned for block 8,263,579 (which was already past when looking at it)
image

but the parachain parachainSystem.ValidationFunctionStored reported the execution would happen on relay block 8,263,577
https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fwss.moonriver.moonbeam.network#/explorer/query/0x62e6661e7adc691420fdc125be711be59b91aaa7fc4e6976e3cd3e408464df84
image

And the parachainSystem.ValidationFunctionApplied reported the execution happened on block 8,263,578
(https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fwss.moonriver.moonbeam.network#/explorer/query/0xef9af479d1bf580fa9289d7bdd331f7d11056e398448c2e888a9eb69224d5c27)
image

According to @bkchr, this is really really bad
:(

(edit)
The code hashes:

paras.futureCodeHash: 0x0180ee63bf0c715462bfcdd8de7072ff462af9ce99226a06b79bb1a581e71449 (spec_version 155)
paras.currentCodeHash: 0x08f6d9aa9cc1f326cf38e3385fe56de65700bc42a3d84350a2224f0d798e18d4 (spec_version 53)

runtime-53 (moonriver) can be found here: https://github.com/PureStake/moonbeam/releases/tag/v0.8.4
runtime-155 (moonriver) can be found here: https://github.com/PureStake/moonbeam/releases/tag/v0.9.2

@xlc
Copy link
Contributor

xlc commented Jul 9, 2021

https://moonriver.subscan.io/block/67640

The parachainSystem.setValidationData sets the relaychain block number to 8262979.

This runtime upgrade is performed using system.setCode via democracy. This means it is called in on_initialize hook, that is executed before inherents. So it is reading the old relaychain block number instead of the new one.

We really need #312 to address this.

Meanwhile, parachain team should be able to use parachainSystem.authorizeUpgrade for democracy and use parachainSystem.enactAuthorizedUpgrade to actually perform the upgrade.

@Sophia-Gold Sophia-Gold transferred this issue from paritytech/polkadot Aug 24, 2023
@the-right-joyce the-right-joyce added I2-bug The node fails to follow expected behavior. and removed I3-bug labels Aug 25, 2023
helin6 pushed a commit to boolnetwork/polkadot-sdk that referenced this issue Feb 5, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Mar 26, 2024
* pass call origin to the message verifier

* is_outbound_lane_enabled -> is_message_accepted

* trait SenderOrigin

* only accept messages from token swap pallet to token swap lane

* tests for edge cases of pay_delivery_and_dispatch_fee

* fixed origin verification

* fmt

* fix benchmarks compilation

* fix TODO with None account and non-zero message fee (already covered by tests)

* revert cargo fmt changes temporarily
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Mar 27, 2024
* pass call origin to the message verifier

* is_outbound_lane_enabled -> is_message_accepted

* trait SenderOrigin

* only accept messages from token swap pallet to token swap lane

* tests for edge cases of pay_delivery_and_dispatch_fee

* fixed origin verification

* fmt

* fix benchmarks compilation

* fix TODO with None account and non-zero message fee (already covered by tests)

* revert cargo fmt changes temporarily
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
* pass call origin to the message verifier

* is_outbound_lane_enabled -> is_message_accepted

* trait SenderOrigin

* only accept messages from token swap pallet to token swap lane

* tests for edge cases of pay_delivery_and_dispatch_fee

* fixed origin verification

* fmt

* fix benchmarks compilation

* fix TODO with None account and non-zero message fee (already covered by tests)

* revert cargo fmt changes temporarily
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
* pass call origin to the message verifier

* is_outbound_lane_enabled -> is_message_accepted

* trait SenderOrigin

* only accept messages from token swap pallet to token swap lane

* tests for edge cases of pay_delivery_and_dispatch_fee

* fixed origin verification

* fmt

* fix benchmarks compilation

* fix TODO with None account and non-zero message fee (already covered by tests)

* revert cargo fmt changes temporarily
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
* pass call origin to the message verifier

* is_outbound_lane_enabled -> is_message_accepted

* trait SenderOrigin

* only accept messages from token swap pallet to token swap lane

* tests for edge cases of pay_delivery_and_dispatch_fee

* fixed origin verification

* fmt

* fix benchmarks compilation

* fix TODO with None account and non-zero message fee (already covered by tests)

* revert cargo fmt changes temporarily
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
* pass call origin to the message verifier

* is_outbound_lane_enabled -> is_message_accepted

* trait SenderOrigin

* only accept messages from token swap pallet to token swap lane

* tests for edge cases of pay_delivery_and_dispatch_fee

* fixed origin verification

* fmt

* fix benchmarks compilation

* fix TODO with None account and non-zero message fee (already covered by tests)

* revert cargo fmt changes temporarily
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
* pass call origin to the message verifier

* is_outbound_lane_enabled -> is_message_accepted

* trait SenderOrigin

* only accept messages from token swap pallet to token swap lane

* tests for edge cases of pay_delivery_and_dispatch_fee

* fixed origin verification

* fmt

* fix benchmarks compilation

* fix TODO with None account and non-zero message fee (already covered by tests)

* revert cargo fmt changes temporarily
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* pass call origin to the message verifier

* is_outbound_lane_enabled -> is_message_accepted

* trait SenderOrigin

* only accept messages from token swap pallet to token swap lane

* tests for edge cases of pay_delivery_and_dispatch_fee

* fixed origin verification

* fmt

* fix benchmarks compilation

* fix TODO with None account and non-zero message fee (already covered by tests)

* revert cargo fmt changes temporarily
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* pass call origin to the message verifier

* is_outbound_lane_enabled -> is_message_accepted

* trait SenderOrigin

* only accept messages from token swap pallet to token swap lane

* tests for edge cases of pay_delivery_and_dispatch_fee

* fixed origin verification

* fmt

* fix benchmarks compilation

* fix TODO with None account and non-zero message fee (already covered by tests)

* revert cargo fmt changes temporarily
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* pass call origin to the message verifier

* is_outbound_lane_enabled -> is_message_accepted

* trait SenderOrigin

* only accept messages from token swap pallet to token swap lane

* tests for edge cases of pay_delivery_and_dispatch_fee

* fixed origin verification

* fmt

* fix benchmarks compilation

* fix TODO with None account and non-zero message fee (already covered by tests)

* revert cargo fmt changes temporarily
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* pass call origin to the message verifier

* is_outbound_lane_enabled -> is_message_accepted

* trait SenderOrigin

* only accept messages from token swap pallet to token swap lane

* tests for edge cases of pay_delivery_and_dispatch_fee

* fixed origin verification

* fmt

* fix benchmarks compilation

* fix TODO with None account and non-zero message fee (already covered by tests)

* revert cargo fmt changes temporarily
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* pass call origin to the message verifier

* is_outbound_lane_enabled -> is_message_accepted

* trait SenderOrigin

* only accept messages from token swap pallet to token swap lane

* tests for edge cases of pay_delivery_and_dispatch_fee

* fixed origin verification

* fmt

* fix benchmarks compilation

* fix TODO with None account and non-zero message fee (already covered by tests)

* revert cargo fmt changes temporarily
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* pass call origin to the message verifier

* is_outbound_lane_enabled -> is_message_accepted

* trait SenderOrigin

* only accept messages from token swap pallet to token swap lane

* tests for edge cases of pay_delivery_and_dispatch_fee

* fixed origin verification

* fmt

* fix benchmarks compilation

* fix TODO with None account and non-zero message fee (already covered by tests)

* revert cargo fmt changes temporarily
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
* pass call origin to the message verifier

* is_outbound_lane_enabled -> is_message_accepted

* trait SenderOrigin

* only accept messages from token swap pallet to token swap lane

* tests for edge cases of pay_delivery_and_dispatch_fee

* fixed origin verification

* fmt

* fix benchmarks compilation

* fix TODO with None account and non-zero message fee (already covered by tests)

* revert cargo fmt changes temporarily
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
* pass call origin to the message verifier

* is_outbound_lane_enabled -> is_message_accepted

* trait SenderOrigin

* only accept messages from token swap pallet to token swap lane

* tests for edge cases of pay_delivery_and_dispatch_fee

* fixed origin verification

* fmt

* fix benchmarks compilation

* fix TODO with None account and non-zero message fee (already covered by tests)

* revert cargo fmt changes temporarily
bkchr pushed a commit that referenced this issue Apr 10, 2024
* pass call origin to the message verifier

* is_outbound_lane_enabled -> is_message_accepted

* trait SenderOrigin

* only accept messages from token swap pallet to token swap lane

* tests for edge cases of pay_delivery_and_dispatch_fee

* fixed origin verification

* fmt

* fix benchmarks compilation

* fix TODO with None account and non-zero message fee (already covered by tests)

* revert cargo fmt changes temporarily
TomaszWaszczyk pushed a commit to TomaszWaszczyk/polkadot-sdk that referenced this issue May 27, 2024
* pass call origin to the message verifier

* is_outbound_lane_enabled -> is_message_accepted

* trait SenderOrigin

* only accept messages from token swap pallet to token swap lane

* tests for edge cases of pay_delivery_and_dispatch_fee

* fixed origin verification

* fmt

* fix benchmarks compilation

* fix TODO with None account and non-zero message fee (already covered by tests)

* revert cargo fmt changes temporarily
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I2-bug The node fails to follow expected behavior.
Projects
None yet
Development

No branches or pull requests

4 participants