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

Update to Polkadot v0.9.6 #219

Merged
merged 4 commits into from
Jul 6, 2021
Merged

Update to Polkadot v0.9.6 #219

merged 4 commits into from
Jul 6, 2021

Conversation

c410-f3r
Copy link
Contributor

@c410-f3r c410-f3r commented Jul 6, 2021

No description provided.


// Prediction Market parameters
parameter_types! {
pub const AdvisoryBond: Balance = 25 * DOLLARS;
pub const AdvisoryBond: Balance = 25 * BASE;
Copy link
Member

Choose a reason for hiding this comment

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

Why was this changed? It should stay low for the testnet.

pub const DisputeBond: Balance = 5 * BASE;
pub const DisputeFactor: Balance = 2 * BASE;
pub const DisputePeriod: BlockNumber = BLOCKS_PER_DAY;
pub const MaxCategories: u16 = 10;
pub const MaxDisputes: u16 = 6;
pub const MinCategories: u16 = 2;
pub const OracleBond: Balance = 50 * DOLLARS;
pub const OracleBond: Balance = 50 * BASE;
Copy link
Member

Choose a reason for hiding this comment

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

Same as above

pub const PmPalletId: PalletId = PalletId(*b"zge/pred");
pub const ReportingPeriod: BlockNumber = BLOCKS_PER_DAY;
pub const ValidityBond: Balance = 50 * DOLLARS;
pub const ValidityBond: Balance = 50 * BASE;
Copy link
Member

Choose a reason for hiding this comment

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

Same

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My Bad. Fixed

@lsaether
Copy link
Member

lsaether commented Jul 6, 2021

Needs to bump the spec version

@lsaether
Copy link
Member

lsaether commented Jul 6, 2021

Since RangeInclusive has changed, it needs to be added/ changed in types.json as well. https://doc.rust-lang.org/nightly/src/core/ops/range.rs.html#341-357

Also, since we expose RangeInclusive as an extrinsic argument, any idea how this works on Polkadot-JS Apps or with the JS layer? I guess we use an object like { start: 0, end: 10, exhausted: false } ? Or can we create an array [0, ... 10] ?

@c410-f3r
Copy link
Contributor Author

c410-f3r commented Jul 6, 2021

Since RangeInclusive has changed, it needs to be added/ changed in types.json as well. https://doc.rust-lang.org/nightly/src/core/ops/range.rs.html#341-357

Also, since we expose RangeInclusive as an extrinsic argument, any idea how this works on Polkadot-JS Apps or with the JS layer? I guess we use an object like { start: 0, end: 10, exhausted: false } ? Or can we create an array [0, ... 10] ?

Support for RangeInclusive was added to parity-scale-codec but apps still doesn't know about RangeInclusive. I am reverting back to (u128, u128) for now because changing to RangeInclusive also implicates a migration

@lsaether
Copy link
Member

lsaether commented Jul 6, 2021

Ok, makes sense. Could you make an issue for this change though? since it seems like something that would be reasonable to do in the future but is lower priority.

@c410-f3r
Copy link
Contributor Author

c410-f3r commented Jul 6, 2021

Ok, makes sense. Could you make an issue for this change though? since it seems like something that would be reasonable to do in the future but is lower priority.

Done -> #220

@lsaether
Copy link
Member

lsaether commented Jul 6, 2021

@sea212 Can you do a quick review on this?

@sea212
Copy link
Member

sea212 commented Jul 6, 2021

@sea212 Can you do a quick review on this?

Sure, I'll take a look at it.

Copy link
Member

@sea212 sea212 left a comment

Choose a reason for hiding this comment

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

Looks good to me.
The currency adjustments are also appropriate and the ExistentialDeposit was also adjusted accordingly, therefore nothing really but the names for the magnitudes of currency should change.

pub const CENTS: Balance = DOLLARS / 100; // 1_000_000
pub const MILLICENTS: Balance = CENTS / 1000; // 1_000
pub const CENT: Balance = BASE / 100; // 100_000_000
pub const MILI: Balance = CENT / 10; // 10_000_000
Copy link
Member

Choose a reason for hiding this comment

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

Just a minor spelling error: Mili -> Milli

PARACHAIN_ID=9123
POLKADOT_BRANCH=release-v0.9.4
POLKADOT_BRANCH=release-v0.9.7
Copy link
Member

Choose a reason for hiding this comment

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

Should this be v0.9.7?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

v0.9.7 because Rococo is probably using this version

Copy link
Member

Choose a reason for hiding this comment

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

But this is the local environment, isn't it? If I understand correctly, we launch the Rococo chain locally "rococo-local". This way or another, I don't mind if it works properly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The branch version is mirroring a production environment the same way PARACHAIN_CHAIN is battery_station_staging instead of dev.

Changed back to 0.9.6

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the clarification.

@@ -65,7 +65,7 @@ pub fn new_partial(
config.transaction_pool.clone(),
config.role.is_authority().into(),
config.prometheus_registry(),
task_manager.spawn_handle(),
task_manager.spawn_essential_handle(),
Copy link
Member

Choose a reason for hiding this comment

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

Does this prevent a client from further operating a tx pool when an error occurs, i.e. the tx pool is shut down (and therefore the client stops operating, at least this service)?

Copy link
Contributor Author

@c410-f3r c410-f3r Jul 6, 2021

Choose a reason for hiding this comment

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

I don't know the difference between an ordinary and an essential task. This code was simply copied and pasted from the 0.9.6 cumulus branch.
https://core.tetcoin.org/rustdocs/v2.0.1/sc_service/struct.TaskManager.html does not state the difference and paritytech/cumulus#496 does not tell why spawn_handle was replaced.
A spawned task is a separated unit of computation (T: Send) that lives with its own context and I don't know if a failed task will prevent the client from further operating a tx pool. If you see https://github.com/paritytech/substrate/blob/4d9f03d3d6d0ceec0708b1a23978feee12f5b0bb/client/service/src/task_manager/mod.rs#L149-L157, then it might be possible that spawn_essential_handle will improve the robustness of the node.

@lsaether lsaether merged commit 7a67a5b into main Jul 6, 2021
@lsaether lsaether deleted the caio-release branch July 7, 2021 19:14
c410-f3r added a commit to c410-f3r/zeitgeist that referenced this pull request Sep 14, 2021
* Update to Polkadot v0.9.6

* Typo

* Change branch to 0.9.6

* Rebase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants