Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Aura: Do not verify on state import #13058

Merged

Conversation

bkchr
Copy link
Member

@bkchr bkchr commented Jan 3, 2023

When we import the state, we can not fetch authorities to verify the seal etc. So, we can directly skip any verification.

When we import the state, we can not fetch authorities to verify the seal etc. So, we can directly
skip any verification.
@bkchr bkchr added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Jan 3, 2023
@bkchr bkchr requested a review from arkpar January 3, 2023 23:16
@samelamin
Copy link
Contributor

samelamin commented Jan 4, 2023

Thanks for this @bkchr!

Using this allowed the chain to be synced up but we still are receiving the same error around verification

2023-01-04 09:03:52.778 DEBUG tokio-runtime-worker sync: [Parachain] State download is complete. Import is queued    
2023-01-04 09:03:52.778  INFO tokio-runtime-worker aura: [Parachain] ****** Block has state, so returning ok    
2023-01-04 09:03:52.783  INFO tokio-runtime-worker sync: [Parachain] Warp sync is complete (0 MiB), restarting block sync.    
2023-01-04 09:03:52.783 DEBUG tokio-runtime-worker sync: [Parachain] Starting gap sync #1 - #190    
2023-01-04 09:03:52.783 DEBUG tokio-runtime-worker sync: [Parachain] Restarted with 191 (0x80a3…d046)    
2023-01-04 09:03:52.783 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x80a3…d046 (191).    
2023-01-04 09:03:52.783 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x80a3…d046 (191).    
2023-01-04 09:03:52.783 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x80a3…d046 (191).    
2023-01-04 09:03:52.783 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x80a3…d046 (191).    
2023-01-04 09:03:52.786 DEBUG tokio-runtime-worker sync: [Parachain] Drained 0 gap blocks from 0    
2023-01-04 09:03:52.787 DEBUG tokio-runtime-worker sync: [Parachain] Drained 128 gap blocks from 0    
2023-01-04 09:03:52.788 DEBUG tokio-runtime-worker sync: [Parachain] Drained 62 gap blocks from 128    
2023-01-04 09:03:52.788 DEBUG tokio-runtime-worker sync::import-queue: [Parachain] Block with unknown parent 129: 0xc2c0222c8e16a727818354423afb922df34f64ca3a2e5f70471ee71fd26bbc80, parent: 0x72d8124bf521b95a8a889da08a4573fc4135745e93eeb4d73139201650c4220c    
2023-01-04 09:03:52.788  WARN tokio-runtime-worker sync: [Parachain] 💔 Verification failed for block 0x7688c2caf3c9847b052a7318b65229a0815c55142ab7a42ce9d0c3d2e3107f84 received from peer: 12D3KooWKM1HeSv61ryZwAiBTZnqmass5pYM48k9Z7obzhTbnphm, "Could not fetch authorities at 0xdc91220f745c32d8386ef9b921b749e27eba1def4a297047c4bc3252d8dba938: Current state of blockchain has invalid authorities set"    
2023-01-04 09:03:52.788 DEBUG tokio-runtime-worker sync: [Parachain] Starting gap sync #2 - #190    
2023-01-04 09:03:52.788 DEBUG tokio-runtime-worker sync: [Parachain] Restarted with 191 (0x80a3…d046)    
2023-01-04 09:03:52.788 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x80a3…d046 (191).    
2023-01-04 09:03:52.788 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x80a3…d046 (191).    
2023-01-04 09:03:52.788 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x80a3…d046 (191).    
2023-01-04 09:03:52.788 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x80a3…d046 (191).    
2023-01-04 09:03:52.788  WARN tokio-runtime-worker sync: [Parachain] 💔 Error importing block 0xc2c0222c8e16a727818354423afb922df34f64ca3a2e5f70471ee71fd26bbc80: block has an unknown parent    
2023-01-04 09:03:52.788 DEBUG tokio-runtime-worker sync: [Parachain] Starting gap sync #2 - #190    
2023-01-04 09:03:52.788 DEBUG tokio-runtime-worker sync: [Parachain] Restarted with 191 (0x80a3…d046)    
2023-01-04 09:03:52.788 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x80a3…d046 (191).    
2023-01-04 09:03:52.788 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x80a3…d046 (191).    
2023-01-04 09:03:52.788 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x80a3…d046 (191).    
2023-01-04 09:03:52.788 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x80a3…d046 (191).    
2023-01-04 09:03:52.788 DEBUG tokio-runtime-worker sync: [Parachain] 12D3KooWKM1HeSv61ryZwAiBTZnqmass5pYM48k9Z7obzhTbnphm disconnected    
2023-01-04 09:03:52.789 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x80a3…d046 (191).    
2023-01-04 09:03:52.789 DEBUG tokio-runtime-worker sync: [Parachain] Connected 12D3KooWKM1HeSv61ryZwAiBTZnqmass5pYM48k9Z7obzhTbnphm    

I seem to also be stuck on Block History, I am going to investigate this today

2023-01-04 09:04:12.418 DEBUG tokio-runtime-worker sync: [Parachain] Request to peer PeerId("12D3KooWFdSt4JnBmxWXwD5yp7wq2WzPaMA1nscSf6qt8pfge8Tk") failed: Refused.    
2023-01-04 09:04:12.418 DEBUG tokio-runtime-worker sync: [Parachain] 12D3KooWFdSt4JnBmxWXwD5yp7wq2WzPaMA1nscSf6qt8pfge8Tk disconnected    
2023-01-04 09:04:12.779  INFO tokio-runtime-worker substrate: [Relaychain] 💤 Idle (6 peers), best: #398 (0x66aa…2635), finalized #395 (0xcd9c…c964), ⬇ 2.9kiB/s ⬆ 2.4kiB/s    
2023-01-04 09:04:12.779  INFO tokio-runtime-worker substrate: [Parachain] ⏩ Block history, #1 (0 peers), best: #193 (0x9bbf…960c), finalized #0 (0x2692…cb5f), ⬇ 0.3kiB/s ⬆ 0.3kiB/s    
2023-01-04 09:04:13.205  INFO tokio-runtime-worker substrate: [Parachain] ✨ Imported #194 (0x001f…6ca6)    
2023-01-04 09:04:13.206 DEBUG tokio-runtime-worker sync: [Parachain] Reannouncing block 0x001f0d0ed167dc49891fdd3b55d25de7825eb964dff3115e0a34e44121bb6ca6 is_best: false    
2023-01-04 09:04:13.385 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x9bbf…960c (193).    
2023-01-04 09:04:13.385 DEBUG tokio-runtime-worker sync: [Parachain] Connected 12D3KooWHmTccx3iQVudoetE7K4ANiproMfppKrXgYd2Gfd1UcTQ    
2023-01-04 09:04:13.387 DEBUG tokio-runtime-worker sync: [Parachain] Request to peer PeerId("12D3KooWHmTccx3iQVudoetE7K4ANiproMfppKrXgYd2Gfd1UcTQ") failed: Refused.    
2023-01-04 09:04:13.387 DEBUG tokio-runtime-worker sync: [Parachain] 12D3KooWHmTccx3iQVudoetE7K4ANiproMfppKrXgYd2Gfd1UcTQ disconnected    
2023-01-04 09:04:13.507 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x9bbf…960c (193).    
2023-01-04 09:04:13.507 DEBUG tokio-runtime-worker sync: [Parachain] Connected 12D3KooWKM1HeSv61ryZwAiBTZnqmass5pYM48k9Z7obzhTbnphm    
2023-01-04 09:04:13.508 DEBUG tokio-runtime-worker sync: [Parachain] Request to peer PeerId("12D3KooWKM1HeSv61ryZwAiBTZnqmass5pYM48k9Z7obzhTbnphm") failed: Refused.    
2023-01-04 09:04:13.508 DEBUG tokio-runtime-worker sync: [Parachain] 12D3KooWKM1HeSv61ryZwAiBTZnqmass5pYM48k9Z7obzhTbnphm disconnected    
2023-01-04 09:04:13.875 DEBUG tokio-runtime-worker sync: [Relaychain] Propagating transactions    
2023-01-04 09:04:13.876 DEBUG tokio-runtime-worker sync: [Parachain] Propagating transactions    
2023-01-04 09:04:14.649 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x9bbf…960c (193).    
2023-01-04 09:04:14.649 DEBUG tokio-runtime-worker sync: [Parachain] Connected 12D3KooWPKzmmE2uYgF3z13xjpbFTp63g9dZFag8pG6MgnpSLF4S    
2023-01-04 09:04:14.650 DEBUG tokio-runtime-worker sync: [Parachain] Request to peer PeerId("12D3KooWPKzmmE2uYgF3z13xjpbFTp63g9dZFag8pG6MgnpSLF4S") failed: Refused.    
2023-01-04 09:04:14.650 DEBUG tokio-runtime-worker sync: [Parachain] 12D3KooWPKzmmE2uYgF3z13xjpbFTp63g9dZFag8pG6MgnpSLF4S disconnected    
2023-01-04 09:04:16.777 DEBUG tokio-runtime-worker sync: [Relaychain] Propagating transactions    
2023-01-04 09:04:16.777 DEBUG tokio-runtime-worker sync: [Parachain] Propagating transactions    
2023-01-04 09:04:17.791  INFO tokio-runtime-worker substrate: [Relaychain] 💤 Idle (6 peers), best: #398 (0x66aa…2635), finalized #396 (0x396e…56b7), ⬇ 2.9kiB/s ⬆ 1.8kiB/s    
2023-01-04 09:04:17.791  INFO tokio-runtime-worker substrate: [Parachain] ⏩ Block history, #1 (0 peers), best: #193 (0x9bbf…960c), finalized #0 (0x2692…cb5f), ⬇ 1.0kiB/s ⬆ 1.2kiB/s    

@bkchr
Copy link
Member Author

bkchr commented Jan 4, 2023

@samelamin I think I know what the problem is. The gap sync needs to be supported as well.

@samelamin
Copy link
Contributor

@samelamin I think I know what the problem is. The gap sync needs to be supported as well.

Yup, looks like its being used in the common import queue too
https://github.com/paritytech/substrate/blob/HEAD/client/consensus/common/src/import_queue.rs#L331-L348

@bkchr
Copy link
Member Author

bkchr commented Jan 4, 2023

@arkpar @andresilva I now skip any checks for when we are importing blocks in the gap. Given that we properly warp synced to the block after the gap, this should be safe? As if someone can sign fake warp sync proofs, they could also produce/sign fake blocks in between? If we would import any fake block in between, we should end up with some invalid chain. Is my reasoning okay or should we do it properly with verifying all signatures etc?

@samelamin
Copy link
Contributor

FYI these changes work. I am able to produce blocks after warp sync

2023-01-04 12:32:56.452  INFO tokio-runtime-worker substrate: [Relaychain] 💤 Idle (6 peers), best: #2485 (0xda5e…dc82), finalized #2482 (0x17ca…b423), ⬇ 609.9kiB/s ⬆ 24.7kiB/s    
2023-01-04 12:32:56.453  INFO tokio-runtime-worker substrate: [Parachain] ⏩ Waiting for pending target block (4 peers), best: #0 (0x2692…cb5f), finalized #0 (0x2692…cb5f), ⬇ 7.6kiB/s ⬆ 5.2kiB/s    
2023-01-04 12:32:56.454  INFO tokio-runtime-worker sync::cumulus: [Parachain] target block reached
2023-01-04 12:32:56.457  INFO tokio-runtime-worker sync: [Parachain] **** target block reached in warp client. Header { parent_hash: 0x14b53d2fca2571bc205bd539b2a90efce3da4b2807e023f401e48cb9db6c86ef, number: 1236, state_root: 0x6062cce469ac3d5b0a47d403be06afd8143b814838f72b16ac5dbbc8fbf3b727, extrinsics_root: 0x4b72874c0ef17297d2f5cbcc0d0d0312ef2de585fb637c287de87e3b980dd410, digest: Digest { logs: [DigestItem::PreRuntime([97, 117, 114, 97], [211, 30, 79, 8, 0, 0, 0, 0]), DigestItem::Seal([97, 117, 114, 97], [12, 71, 134, 161, 99, 198, 22, 139, 53, 124, 39, 23, 181, 254, 46, 19, 46, 123, 195, 36, 10, 76, 39, 124, 191, 32, 150, 76, 10, 65, 200, 73, 180, 231, 101, 249, 142, 28, 90, 46, 167, 241, 194, 100, 219, 187, 47, 166, 46, 11, 184, 99, 226, 80, 67, 14, 240, 20, 179, 173, 233, 0, 88, 142])] } }    
2023-01-04 12:32:56.457  INFO tokio-runtime-worker sync: [Parachain] **** block justifications are None    
2023-01-04 12:32:56.457  INFO tokio-runtime-worker sync: [Parachain] ***** target block number is 1236    
2023-01-04 12:32:56.468 DEBUG tokio-runtime-worker sync: [Parachain] Importing state data from 12D3KooWHmTccx3iQVudoetE7K4ANiproMfppKrXgYd2Gfd1UcTQ with 0 keys, 619621 proof nodes.    
2023-01-04 12:32:56.468 DEBUG tokio-runtime-worker sync: [Parachain] Importing state from 619621 trie nodes    
2023-01-04 12:32:56.471 DEBUG tokio-runtime-worker sync: [Parachain] Imported with 315 keys    
2023-01-04 12:32:56.471 DEBUG tokio-runtime-worker sync: [Parachain] State download is complete. Import is queued    
2023-01-04 12:32:56.472  INFO tokio-runtime-worker aura: [Parachain] ***** Aura. Block has state, so returning ok    
2023-01-04 12:32:56.477  INFO tokio-runtime-worker sync: [Parachain] Warp sync is complete (0 MiB), restarting block sync.    
2023-01-04 12:32:56.477 DEBUG tokio-runtime-worker sync: [Parachain] Starting gap sync #1 - #1235    
2023-01-04 12:32:56.477 DEBUG tokio-runtime-worker sync: [Parachain] Restarted with 1236 (0x7430…40ca)    
2023-01-04 12:32:56.477 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x7430…40ca (1236).    
2023-01-04 12:32:56.477 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x7430…40ca (1236).    
2023-01-04 12:32:56.477 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x7430…40ca (1236).    
2023-01-04 12:32:56.477 DEBUG tokio-runtime-worker sync: [Parachain] New peer with known best hash 0x7430…40ca (1236).    
2023-01-04 12:32:56.481 DEBUG tokio-runtime-worker sync: [Parachain] Drained 0 gap blocks from 0    
2023-01-04 12:32:56.482 DEBUG tokio-runtime-worker sync: [Parachain] Drained 0 gap blocks from 0    
2023-01-04 12:32:56.482 DEBUG tokio-runtime-worker sync: [Parachain] Drained 192 gap blocks from 0    
2023-01-04 12:32:56.483 DEBUG tokio-runtime-worker sync: [Parachain] Drained 64 gap blocks from 192    
2023-01-04 12:32:56.485 DEBUG tokio-runtime-worker sync: [Parachain] Drained 0 gap blocks from 256    
2023-01-04 12:32:56.486 DEBUG tokio-runtime-worker sync: [Parachain] Drained 0 gap blocks from 256    
2023-01-04 12:32:56.486 DEBUG tokio-runtime-worker sync: [Parachain] Drained 64 gap blocks from 256    
2023-01-04 12:32:56.487 DEBUG tokio-runtime-worker sync: [Parachain] Drained 192 gap blocks from 320    
2023-01-04 12:32:56.490 DEBUG tokio-runtime-worker sync: [Parachain] Drained 0 gap blocks from 512    
2023-01-04 12:32:56.492 DEBUG tokio-runtime-worker sync: [Parachain] Drained 0 gap blocks from 512    
2023-01-04 12:32:56.493 DEBUG tokio-runtime-worker sync: [Parachain] Drained 0 gap blocks from 512    
2023-01-04 12:32:56.493 DEBUG tokio-runtime-worker sync: [Parachain] Drained 256 gap blocks from 512    
2023-01-04 12:32:56.494 DEBUG tokio-runtime-worker sync: [Parachain] Drained 64 gap blocks from 768    
2023-01-04 12:32:56.497 DEBUG tokio-runtime-worker sync: [Parachain] Drained 0 gap blocks from 832    
2023-01-04 12:32:56.497 DEBUG tokio-runtime-worker sync: [Parachain] Drained 0 gap blocks from 832    
2023-01-04 12:32:56.498 DEBUG tokio-runtime-worker sync: [Parachain] Drained 0 gap blocks from 832    
2023-01-04 12:32:56.498 DEBUG tokio-runtime-worker sync: [Parachain] Drained 256 gap blocks from 832    
2023-01-04 12:32:56.499 DEBUG tokio-runtime-worker sync: [Parachain] Drained 0 gap blocks from 1088    
2023-01-04 12:32:56.501 DEBUG tokio-runtime-worker sync: [Parachain] Drained 0 gap blocks from 1088    
2023-01-04 12:32:56.501 DEBUG tokio-runtime-worker sync: [Parachain] Drained 147 gap blocks from 1088    
2023-01-04 12:32:56.517  INFO tokio-runtime-worker sync: [Parachain] Block history download is complete.    
2023-01-04 12:32:57.242 DEBUG tokio-runtime-worker sync: [Relaychain] Propagating transactions    
2023-01-04 12:32:57.255 DEBUG tokio-runtime-worker sync: [Parachain] Propagating transactions    
2023-01-04 12:32:57.799 DEBUG tokio-runtime-worker sync: [Relaychain] Pre-validating received block announcement 0xdfd141985ffaf94240307c971aa69d46dcb2ac656b882fe7f86462c517b9b359 with number 2483 from 12D3KooWQCkBm1BYtkHpocxCwMgR8yjitEeHGx8spzcDLGt2gkBm    
2023-01-04 12:32:57.800 DEBUG tokio-runtime-worker sync: [Relaychain] Pre-validating received block announcement 0xdfd141985ffaf94240307c971aa69d46dcb2ac656b882fe7f86462c517b9b359 with number 2483 from 12D3KooWRkZhiRhsqmrQ28rt73K7V3aCBpqKrLGSXmZ99PTcTZby    
2023-01-04 12:33:00.014 DEBUG tokio-runtime-worker sync: [Relaychain] Pre-validating received block announcement 0x5b1d3617825f39c109372fde6897afc4c447d6633fb205701afbe341fdf9958d with number 2486 from 12D3KooWQCkBm1BYtkHpocxCwMgR8yjitEeHGx8spzcDLGt2gkBm    
2023-01-04 12:33:00.015 DEBUG tokio-runtime-worker sync: [Relaychain] Pre-validating received block announcement 0xf03759a671acbc61feec51064b083424d63ac7e005bf4446ea08098c60e639a0 with number 2486 from 12D3KooWRkZhiRhsqmrQ28rt73K7V3aCBpqKrLGSXmZ99PTcTZby    
2023-01-04 12:33:00.019  INFO tokio-runtime-worker substrate: [Relaychain] ✨ Imported #2486 (0x5b1d…958d)    
2023-01-04 12:33:00.019 DEBUG tokio-runtime-worker sync: [Relaychain] Pre-validating received block announcement 0x5b1d3617825f39c109372fde6897afc4c447d6633fb205701afbe341fdf9958d with number 2486 from 12D3KooWRkZhiRhsqmrQ28rt73K7V3aCBpqKrLGSXmZ99PTcTZby    
2023-01-04 12:33:00.019 DEBUG tokio-runtime-worker sync: [Relaychain] Reannouncing block 0x5b1d3617825f39c109372fde6897afc4c447d6633fb205701afbe341fdf9958d is_best: true    
2023-01-04 12:33:00.019 DEBUG tokio-runtime-worker sync: [Relaychain] New best block imported 0x5b1d3617825f39c109372fde6897afc4c447d6633fb205701afbe341fdf9958d/#2486    
2023-01-04 12:33:00.020 DEBUG tokio-runtime-worker sync: [Relaychain] Pre-validating received block announcement 0x5b1d3617825f39c109372fde6897afc4c447d6633fb205701afbe341fdf9958d with number 2486 from 12D3KooWD4RZB2yvebFXBcvmkoDzXdAonzWQx7JTANDd7uPcMYkv    
2023-01-04 12:33:00.021 DEBUG tokio-runtime-worker sync: [Relaychain] Pre-validating received block announcement 0x5b1d3617825f39c109372fde6897afc4c447d6633fb205701afbe341fdf9958d with number 2486 from 12D3KooWMWcasFPz6R29SmgEA8TwCfRZzLdEdZsWwpx6b71fzwwe    
2023-01-04 12:33:00.021 DEBUG tokio-runtime-worker sync: [Relaychain] Pre-validating received block announcement 0x5b1d3617825f39c109372fde6897afc4c447d6633fb205701afbe341fdf9958d with number 2486 from 12D3KooWPCzwMhmBwvzmLkdh2iCPUSF9DtZa7uWugBkZYmX9sz5p    
2023-01-04 12:33:00.021 DEBUG tokio-runtime-worker sync: [Relaychain] Pre-validating received block announcement 0x5b1d3617825f39c109372fde6897afc4c447d6633fb205701afbe341fdf9958d with number 2486 from 12D3KooWJ1Y9MEcHqJgbHd6s8pjMaR7RjeowW9C3UjqXcu5xMbGC    
2023-01-04 12:33:00.022 DEBUG tokio-runtime-worker sync: [Relaychain] Pre-validating received block announcement 0xf03759a671acbc61feec51064b083424d63ac7e005bf4446ea08098c60e639a0 with number 2486 from 12D3KooWD4RZB2yvebFXBcvmkoDzXdAonzWQx7JTANDd7uPcMYkv    
2023-01-04 12:33:00.023 DEBUG tokio-runtime-worker sync: [Relaychain] Pre-validating received block announcement 0xf03759a671acbc61feec51064b083424d63ac7e005bf4446ea08098c60e639a0 with number 2486 from 12D3KooWQCkBm1BYtkHpocxCwMgR8yjitEeHGx8spzcDLGt2gkBm    
2023-01-04 12:33:00.024 DEBUG tokio-runtime-worker sync: [Relaychain] Reannouncing block 0xf03759a671acbc61feec51064b083424d63ac7e005bf4446ea08098c60e639a0 is_best: false    
2023-01-04 12:33:00.024  INFO tokio-runtime-worker substrate: [Relaychain] ✨ Imported #2486 (0xf037…39a0)    
2023-01-04 12:33:00.035  INFO tokio-runtime-worker parachain::approval-voting: [Relaychain] Advanced session window for approvals update=Advanced { prev_window_start: 0, prev_window_end: 0, new_window_start: 243, new_window_end: 248 }
2023-01-04 12:33:00.147 DEBUG tokio-runtime-worker sync: [Relaychain] Propagating transactions    
2023-01-04 12:33:00.157 DEBUG tokio-runtime-worker sync: [Parachain] Propagating transactions    
2023-01-04 12:33:01.453  INFO tokio-runtime-worker substrate: [Relaychain] 💤 Idle (6 peers), best: #2486 (0x5b1d…958d), finalized #2483 (0xdfd1…b359), ⬇ 4.6kiB/s ⬆ 2.4kiB/s    
2023-01-04 12:33:01.454  INFO tokio-runtime-worker substrate: [Parachain] 💤 Idle (4 peers), best: #1236 (0x7430…40ca), finalized #1235 (0x14b5…86ef), ⬇ 908.3kiB/s ⬆ 1.3kiB/s    
2023-01-04 12:33:01.767  INFO tokio-runtime-worker substrate: [Parachain] ✨ Imported #1237 (0x03bf…ce30)    
2023-01-04 12:33:01.768 DEBUG tokio-runtime-worker sync: [Parachain] Reannouncing block 0x03bf0ecd3b0b5ce6d09eaf1279c15f7e4a6d70eda85f82d0207c64ee9e40ce30 is_best: false    
2023-01-04 12:33:01.807 DEBUG tokio-runtime-worker sync: [Relaychain] Pre-validating received block announcement 0xf781cea527b5cd4de29d0df0866165f37d2ff881cf7c377f039cf6a3f683fbc5 with number 2484 from 12D3KooWQCkBm1BYtkHpocxCwMgR8yjitEeHGx8spzcDLGt2gkBm    
2023-01-04 12:33:01.808 DEBUG tokio-runtime-worker sync: [Relaychain] Pre-validating received block announcement 0xf781cea527b5cd4de29d0df0866165f37d2ff881cf7c377f039cf6a3f683fbc5 with number 2484 from 12D3KooWRkZhiRhsqmrQ28rt73K7V3aCBpqKrLGSXmZ99PTcTZby    
2023-01-04 12:33:03.050 DEBUG tokio-runtime-worker sync: [Relaychain] Propagating transactions    
2023-01-04 12:33:03.060 DEBUG tokio-runtime-worker sync: [Parachain] Propagating transactions    
2023-01-04 12:33:05.955 DEBUG tokio-runtime-worker sync: [Relaychain] Propagating transactions    
2023-01-04 12:33:05.961 DEBUG tokio-runtime-worker sync: [Parachain] Propagating transactions    
2023-01-04 12:33:06.019 DEBUG tokio-runtime-worker sync: [Relaychain] Pre-validating received block announcement 0xb1bcf6e003b9a32fcdf116402cc58e87b0f4109c789727c795853bff6bd30175 with number 2487 from 12D3KooWRkZhiRhsqmrQ28rt73K7V3aCBpqKrLGSXmZ99PTcTZby    
2023-01-04 12:33:06.025  INFO tokio-runtime-worker substrate: [Relaychain] ✨ Imported #2487 (0xb1bc…0175)    
2023-01-04 12:33:06.026 DEBUG tokio-runtime-worker sync: [Relaychain] Pre-validating received block announcement 0xb1bcf6e003b9a32fcdf116402cc58e87b0f4109c789727c795853bff6bd30175 with number 2487 from 12D3KooWQCkBm1BYtkHpocxCwMgR8yjitEeHGx8spzcDLGt2gkBm    
2023-01-04 12:33:06.026 DEBUG tokio-runtime-worker sync: [Relaychain] Reannouncing block 0xb1bcf6e003b9a32fcdf116402cc58e87b0f4109c789727c795853bff6bd30175 is_best: true    
2023-01-04 12:33:06.026 DEBUG tokio-runtime-worker sync: [Relaychain] New best block imported 0xb1bcf6e003b9a32fcdf116402cc58e87b0f4109c789727c795853bff6bd30175/#2487    
2023-01-04 12:33:06.026 DEBUG tokio-runtime-worker sync: [Parachain] Reannouncing block 0x03bf0ecd3b0b5ce6d09eaf1279c15f7e4a6d70eda85f82d0207c64ee9e40ce30 is_best: true    
2023-01-04 12:33:06.026 DEBUG tokio-runtime-worker sync: [Parachain] New best block imported 0x03bf0ecd3b0b5ce6d09eaf1279c15f7e4a6d70eda85f82d0207c64ee9e40ce30/#1237    
2023-01-04 12:33:06.027 DEBUG tokio-runtime-worker sync: [Relaychain] Pre-validating received block announcement 0xb1bcf6e003b9a32fcdf116402cc58e87b0f4109c789727c795853bff6bd30175 with number 2487 from 12D3KooWMWcasFPz6R29SmgEA8TwCfRZzLdEdZsWwpx6b71fzwwe    
2023-01-04 12:33:06.027 DEBUG tokio-runtime-worker sync: [Relaychain] Pre-validating received block announcement 0xb1bcf6e003b9a32fcdf116402cc58e87b0f4109c789727c795853bff6bd30175 with number 2487 from 12D3KooWPCzwMhmBwvzmLkdh2iCPUSF9DtZa7uWugBkZYmX9sz5p    
2023-01-04 12:33:06.027 DEBUG tokio-runtime-worker sync: [Relaychain] Pre-validating received block announcement 0xb1bcf6e003b9a32fcdf116402cc58e87b0f4109c789727c795853bff6bd30175 with number 2487 from 12D3KooWJ1Y9MEcHqJgbHd6s8pjMaR7RjeowW9C3UjqXcu5xMbGC    
2023-01-04 12:33:06.039  INFO tokio-runtime-worker cumulus-collator: [Parachain] Starting collation. relay_parent=0xb1bcf6e003b9a32fcdf116402cc58e87b0f4109c789727c795853bff6bd30175 at=0x03bf0ecd3b0b5ce6d09eaf1279c15f7e4a6d70eda85f82d0207c64ee9e40ce30
2023-01-04 12:33:06.113 DEBUG tokio-runtime-worker sync: [Parachain] Pre-validating received block announcement 0x20841d185214a5e52709eb4a56102ba7b02750eebd1314fc4fdeaecf84659ecb with number 1238 from 12D3KooWKM1HeSv61ryZwAiBTZnqmass5pYM48k9Z7obzhTbnphm    
2023-01-04 12:33:06.116  INFO tokio-runtime-worker substrate: [Parachain] ✨ Imported #1238 (0x2084…9ecb) 

@andresilva
Copy link
Contributor

@bkchr I think your reasoning is correct, assuming we checked a finality proof before warping to this block then it should not be possible to fool us into syncing a fake chain before the warp (you'd have to break the block hash function). We can create an issue as a nice-to-have to validate these signatures but we'd need to change Aura to keep track of authorities on the client-side (using digests) like we do for BABE, this way we wouldn't require the state to be available to figure out the authorities.

client/consensus/aura/src/import_queue.rs Outdated Show resolved Hide resolved
//
// It is expected that the block after the gap was checked/chosen properly, e.g. by warp
// syncing to this block.
if info
Copy link
Member

Choose a reason for hiding this comment

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

Instead of checking for gaps specifically, just check for block.state_action.skip_execution_checks()
It returns true when all checks that involve calling into parent runtime should be skipped.

Copy link
Member

Choose a reason for hiding this comment

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

Might as well remove the same check on line 249 below.

@bkchr
Copy link
Member Author

bkchr commented Jan 4, 2023

bot merge

@paritytech-processbot paritytech-processbot bot merged commit ea387c6 into master Jan 4, 2023
@paritytech-processbot paritytech-processbot bot deleted the bkchr-aura-do-not-verify-on-state-import branch January 4, 2023 13:17
dandanlen pushed a commit to chainflip-io/substrate that referenced this pull request Jan 23, 2023
* Aura: Do not verify on state import

When we import the state, we can not fetch authorities to verify the seal etc. So, we can directly
skip any verification.

* Skip checks as well for gap sync

* Update client/consensus/aura/src/import_queue.rs

Co-authored-by: André Silva <[email protected]>

* Review comment

Co-authored-by: André Silva <[email protected]>
dandanlen pushed a commit to chainflip-io/substrate that referenced this pull request Jan 23, 2023
* Aura: Do not verify on state import

When we import the state, we can not fetch authorities to verify the seal etc. So, we can directly
skip any verification.

* Skip checks as well for gap sync

* Update client/consensus/aura/src/import_queue.rs

Co-authored-by: André Silva <[email protected]>

* Review comment

Co-authored-by: André Silva <[email protected]>
ltfschoen pushed a commit to ltfschoen/substrate that referenced this pull request Feb 22, 2023
* Aura: Do not verify on state import

When we import the state, we can not fetch authorities to verify the seal etc. So, we can directly
skip any verification.

* Skip checks as well for gap sync

* Update client/consensus/aura/src/import_queue.rs

Co-authored-by: André Silva <[email protected]>

* Review comment

Co-authored-by: André Silva <[email protected]>
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
* Aura: Do not verify on state import

When we import the state, we can not fetch authorities to verify the seal etc. So, we can directly
skip any verification.

* Skip checks as well for gap sync

* Update client/consensus/aura/src/import_queue.rs

Co-authored-by: André Silva <[email protected]>

* Review comment

Co-authored-by: André Silva <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants