-
Notifications
You must be signed in to change notification settings - Fork 151
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
fix: support calc fee for Karura and Acala #754
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { ControllerConfig } from '../types/chains-config'; | ||
import { initLRUCache } from './cache/lruCache'; | ||
import { getBlockWeight } from './metadata-consts'; | ||
|
||
/** | ||
* Controllers for Acala collator | ||
*/ | ||
export const acalaControllers: ControllerConfig = { | ||
controllers: [ | ||
'AccountsBalanceInfo', | ||
'AccountsValidate', | ||
'Blocks', | ||
'BlocksExtrinsics', | ||
'NodeNetwork', | ||
'NodeTransactionPool', | ||
'NodeVersion', | ||
'PalletsStorage', | ||
'Paras', | ||
'RuntimeCode', | ||
'RuntimeMetadata', | ||
'RuntimeSpec', | ||
'TransactionDryRun', | ||
'TransactionFeeEstimate', | ||
'TransactionMaterial', | ||
'TransactionSubmit', | ||
], | ||
options: { | ||
finalizes: true, | ||
minCalcFeeRuntime: 2000, | ||
blockWeightStore: getBlockWeight('acala'), | ||
blockStore: initLRUCache(), | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { ControllerConfig } from '../types/chains-config'; | ||
import { initLRUCache } from './cache/lruCache'; | ||
import { getBlockWeight } from './metadata-consts'; | ||
|
||
/** | ||
* Controllers for Karura collator | ||
*/ | ||
export const karuraControllers: ControllerConfig = { | ||
controllers: [ | ||
'AccountsBalanceInfo', | ||
'AccountsValidate', | ||
'Blocks', | ||
'BlocksExtrinsics', | ||
'NodeNetwork', | ||
'NodeTransactionPool', | ||
'NodeVersion', | ||
'PalletsStorage', | ||
'Paras', | ||
'RuntimeCode', | ||
'RuntimeMetadata', | ||
'RuntimeSpec', | ||
'TransactionDryRun', | ||
'TransactionFeeEstimate', | ||
'TransactionMaterial', | ||
'TransactionSubmit', | ||
], | ||
options: { | ||
finalizes: true, | ||
minCalcFeeRuntime: 1000, | ||
blockWeightStore: getBlockWeight('karura'), | ||
blockStore: initLRUCache(), | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { MetadataConsts } from '../../types/chains-config'; | ||
import { extrinsicBaseWeight } from './substrateConsts'; | ||
|
||
export const acalaDefinitions: MetadataConsts[] = [ | ||
{ | ||
runtimeVersions: [2000, 2001, 2002], | ||
extrinsicBaseWeight, | ||
}, | ||
]; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { MetadataConsts } from '../../types/chains-config'; | ||
import { extrinsicBaseWeight } from './substrateConsts'; | ||
|
||
export const karuraDefinitions: MetadataConsts[] = [ | ||
{ | ||
runtimeVersions: [ | ||
1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to list all the runtime versions? Do we need to PR here if we did a runtime upgrade? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea and yes. If it doesnt have your new runtime version immediately thats alright, we just end up searching the decorated metadata for the weights for the missing runtime then cache it for the server instance. |
||
1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 2000, 2001, | ||
], | ||
extrinsicBaseWeight, | ||
}, | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be a way to configure this without modify rust code. at least for common cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea we have had discussion about this, especially since parachains are going to want more and more support for fee calculations as time moves on. We thought about a plugin, and some different options. Still something to consider but I agree.