Skip to content

fix: fast track proposal script #1112

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions js-packages/scripts/blocktimes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const MILLISECS_PER_BLOCK = 6000;

export const MINUTES = 60_000 / MILLISECS_PER_BLOCK;
export const HOURS = 60 * MINUTES;
export const DAYS = 24 * HOURS;
3 changes: 2 additions & 1 deletion js-packages/scripts/proposefasttrack.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {ApiPromise, WsProvider} from '@polkadot/api';
import {blake2AsHex} from '@polkadot/util-crypto';
import {DAYS} from './blocktimes';

async function main() {
if(process.argv.length != 4) {
Expand Down Expand Up @@ -28,7 +29,7 @@ async function main() {
proposalHash = proposal;
}

const voringPeriod = 7200;
const voringPeriod = 1 * DAYS;
Copy link
Member

Choose a reason for hiding this comment

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

14400

Но ведь это даже дольше, по тому что в чате было написано я думал что надо наоборот меньше?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Достаточно чтобы было равно одному дню. Демократия начинает требовать InstantOrigin только если voting period строго меньше сконфигурированного минимального периода фаст-стрека

Copy link
Contributor Author

Choose a reason for hiding this comment

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

14400, почему дольше? Это же буквально один день, у нас так и сконфигуриванно

Copy link
Member

@CertainLach CertainLach Jun 30, 2025

Choose a reason for hiding this comment

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

Честно говоря я вообще не понимаю что тут не так, там же по коду описание стоит

            // Rather complicated bit of code to ensure that either:
            // - voting_period is at least FastTrackVotingPeriod and origin is
            //   FastTrackOrigin; or
            // - InstantAllowed is true and origin is InstantOrigin.
        pub FastTrackVotingPeriod: BlockNumber = 10 * MINUTES;

И у нас изначально 7200 is at least 10 minutes & origin = fast track origin

Copy link
Contributor Author

Choose a reason for hiding this comment

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

У нас на разных рантаймах разные тайминги, на Кварце это один день:

pub FastTrackVotingPeriod: BlockNumber = 1 * DAYS;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

На Опале короткий

Copy link
Member

Choose a reason for hiding this comment

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

А, блин, точно. Теперь всё понял

Copy link
Member

Choose a reason for hiding this comment

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

Я только common тайминги смотрел и не понимал что тут не так)

const delay = 10;

const democracyFastTrack = api.tx.democracy.fastTrack(proposalHash, voringPeriod, delay);
Expand Down
Loading