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

[WIP] Add support for Moonriver #95

Merged
merged 23 commits into from
Jan 11, 2023
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
80ab0b7
Draft support for Moonriver
crystalin Dec 17, 2022
b028dbe
Merge branch 'master' into crystalin-moonriver
crystalin Dec 18, 2022
ed87ac2
Better storage modification for Moonriver
crystalin Dec 18, 2022
d0887e4
Merge branch 'master' into crystalin-moonriver
crystalin Dec 18, 2022
d9775a1
temp fix for default storage issue
crystalin Dec 18, 2022
cb8349c
Merge branch 'master' into crystalin-moonriver
crystalin Dec 19, 2022
3db2d02
removes notFirstBlock
crystalin Dec 19, 2022
8c276a7
remove unnecessary randomness storage modification
crystalin Dec 19, 2022
72fc9b3
Adds RT2100 Dev image in authorized upgrade
crystalin Dec 19, 2022
105c12e
Merge branch 'master' into crystalin-moonriver
crystalin Dec 19, 2022
c546ccf
Better support for nmbs engine
crystalin Dec 20, 2022
cad8131
Merge branch 'master' into crystalin-moonriver
crystalin Dec 20, 2022
2045c72
fix missing import
crystalin Dec 20, 2022
e80a133
lint
crystalin Dec 20, 2022
33d6f98
Merge branch 'master' into crystalin-moonriver
crystalin Dec 20, 2022
1c7bce6
Merge branch 'master' into crystalin-moonriver
crystalin Dec 21, 2022
da111ca
Update src/blockchain/txpool.ts
Dec 28, 2022
83e760b
Merge branch 'master' into crystalin-moonriver
crystalin Dec 28, 2022
c86d47a
Fix inherents
crystalin Dec 28, 2022
0d897fe
Removes extra storage push
crystalin Dec 29, 2022
4d77abf
Better file split
crystalin Dec 29, 2022
ec0772f
fix e2e imports
crystalin Dec 29, 2022
c917476
Merge branch 'master' into crystalin-moonriver
crystalin Jan 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/blockchain/txpool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { InherentProvider } from './inherents'
import { ResponseError } from '../rpc/shared'
import { compactHex } from '../utils'
import { defaultLogger, truncate, truncateStorageDiff } from '../logger'
import { StorageValueKind } from './storage-layer'

const logger = defaultLogger.child({ name: 'txpool' })

Expand Down Expand Up @@ -105,6 +106,7 @@ export class TxPool {
},
})

head.pushStorageLayer().set(compactHex(meta.query.randomness.notFirstBlock()), StorageValueKind.Deleted)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xlc not sure what we could do here. Ideally, the signature should be mocked too but quickly looking at the randomness pallet I don't see much how this could be done.
A temporary solution is to remove the NotFirstBlock but it needs to be pallet specific and also break support for randomness.
Any idea ?

Copy link
Member

Choose a reason for hiding this comment

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

how does the randomness pallet verify the VRF? if that's using host function than we can mock it. otherwise I can see few options:

  • modify randomness pallet to make it mock friendly. e.g. if a particular storage exists or not exists, switch to mock mode
  • refactor chopsticks to support plugins so we can better manage pallet specific code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

const newBlock = this.#chain.newTempBlock(head, header)

logger.info(
Expand Down Expand Up @@ -164,6 +166,10 @@ export class TxPool {

const resp2 = await newBlock.call('BlockBuilder_finalize_block', '0x')

if (meta.query.randomness?.notFirstBlock) {
newBlock.pushStorageLayer().set(compactHex(meta.query.randomness.notFirstBlock()), StorageValueKind.Deleted)
crystalin marked this conversation as resolved.
Show resolved Hide resolved
}

newBlock.pushStorageLayer().setAll(resp2.storageDiff)
logger.trace(truncateStorageDiff(resp2.storageDiff), 'Finalize block')

Expand Down