Skip to content

fix: re-enable storage in CI & fix setupNewChain test - #4608

Merged
mnaamani merged 41 commits into
Joystream:ephesusfrom
dobertRowneySr:ephesus-CICD-fix
Feb 20, 2023
Merged

mnaamani merged 41 commits into
Joystream:ephesusfrom
dobertRowneySr:ephesus-CICD-fix

Conversation

@dobertRowneySr

@dobertRowneySr dobertRowneySr commented Feb 7, 2023 •

Copy link
Copy Markdown
Collaborator

Fixes #4609

┆Issue is synchronized with this Asana task by Unito

@vercel

vercel Bot commented Feb 7, 2023 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated
pioneer-testnet ⬜️ Ignored (Inspect) Feb 16, 2023 at 10:07AM (UTC)

@dobertRowneySr

Copy link
Copy Markdown
Collaborator Author

The playground deployment is failing locally due to council election timing out, I have updated the timeout limits and I am testing

@dobertRowneySr

dobertRowneySr commented Feb 8, 2023 •

Copy link
Copy Markdown
Collaborator Author

The playground deployment is failing locally due to council election timing out, I have updated the timeout limits and I am testing

This is was due to the tests/network-tests/src/Api::untilCouncilStage final check for which the IdlePeriod (=1) >= reserve (=4) (in the playground config). So the playground election used to get stuck.
I have set reserve = 1 and then ran the local playground successfully

@dobertRowneySr

Copy link
Copy Markdown
Collaborator Author

I have also set shorter duration parameters for duration election and lead proposal

@mnaamani
mnaamani requested a review from Lezek123 February 9, 2023 08:36
@mnaamani

mnaamani commented Feb 9, 2023

Copy link
Copy Markdown
Member

Was able to do a deployment, and running a test now also through github action https://github.com/Joystream/joystream/actions/runs/4134320191

One useful addition I can think of is to perhaps give the council member member controller account a custom key, like we do for the working group workers to setup the storage infrastructure with pre-determined accounts. This will make it easy for testers of the playground to add these keys rather than needed to setup a new council with their own keys. As they will need to test specific proposals..

@mnaamani

mnaamani commented Feb 9, 2023 •

Copy link
Copy Markdown
Member

Was able to do a deployment, and running a test now also through github action https://github.com/Joystream/joystream/actions/runs/4134320191

The ansible job timed out, so prepared a PR to increase the timeout dobertRowneySr#9

Successful deployment https://github.com/Joystream/joystream/actions/runs/4138130693/jobs/7154156247

@mnaamani mnaamani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great job fixing this. Please update the timeout for ansible job by merging dobertRowneySr#9

If you can add the suggested deterministic account for council memebers it would be great finishing touch.

allow more time for playground to deploy before timeout
Comment thread runtime/src/proposals_configuration/playground.rs Outdated
Comment thread runtime/src/proposals_configuration/playground.rs Outdated
Comment thread tests/network-tests/src/Api.ts Outdated
targetStage: 'Announcing' | 'Voting' | 'Revealing' | 'Idle',
announcementPeriodNr: number | null = null,
blocksReserve = 4,
blocksReserve = 1, // TODO dynamically adjust this as it stuck the election process

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What do you mean by "stuck the election process"?
I think there is a risk in having the reserve default to as low as 1, as this may not be enough time for the integration tests to issue all transactions intended for a given stage (like announcing all candidacies during announcing stage) and we may experience some issues w/ the integration tests occasionally failing.

@dobertRowneySr dobertRowneySr Feb 10, 2023 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is was due to the tests/network-tests/src/Api::untilCouncilStage final check for which the IdlePeriod (=1) >= reserve (=4) (in the playground config). So the playground election used to get stuck.
I have set reserve = 1 and then ran the local playground successfully

I will to set Idle period to 5 for the playground

@Joystream Joystream deleted a comment from vercel Bot Feb 10, 2023
@dobertRowneySr
dobertRowneySr changed the base branch from ephesus to master February 14, 2023 18:32
@dobertRowneySr
dobertRowneySr changed the base branch from master to ephesus February 14, 2023 18:32

@mnaamani mnaamani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, just left a couple of code cleanup points, and suggestion to increase the timeout of the ansible job slightly, otherwise its good to go.

// Announcing stage
await this.api.untilCouncilStage('Announcing')
const x = await this.api.query.council.announcementPeriodNr()
this.debug(`announcement period ${x.toNumber()}`)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps your intention here is to debug/check that we are still in the announcing period expected. Maybe assert the condition instead of logging and continuing?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I used it to display the announcement period, because the first election starts in Announcing stage while subsequent test elections starts in Idle, that way the announcing period between the first and the second election was the same and so the addresses for the candidates

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I have removed it now

export default async function electCouncil({ api, query }: FlowProps): Promise<void> {
export default async function electCouncil(props: FlowProps): Promise<void> {
const debug = extendDebug('flow:elect-council')
const { api, query } = props

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

all changes in this file seem no longer necessary

Comment thread tests/network-tests/.env Outdated
# Mini-secret or mnemonic used in SURI for deterministic key derivation
SURI_MINI_SECRET=""
# Single councilor account SURI used for testing
COUNCILLOR_SURI=//Councillor

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this can be removed now.

Comment thread devops/ansible/deploy-playground-playbook.yml Outdated
Comment thread devops/ansible/deploy-playground-playbook.yml Outdated
Ignazio Bovo and others added 3 commits February 15, 2023 13:04
Co-authored-by: Mokhtar Naamani <mokhtar.naamani@gmail.com>
Co-authored-by: Mokhtar Naamani <mokhtar.naamani@gmail.com>
Comment thread tests/network-tests/src/fixtures/council/ElectCouncilFixture.ts Outdated
Comment on lines +25 to +29
if (stage.isAnnouncing) {
return announcementPeriodId.toNumber()
} else {
return announcementPeriodId.toNumber() + 1
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This will not always work, because:

  • It doesn't take into account the "block reserve" (ie. whether the announcing period has less than blockReserve blocks left)
  • There are a few more actions ran after this check, for example, the BuyMembershipHappyCaseFixture. After those actions are finished, the stage may already be different (if the announcing period was close to an end).

One way to solve this would be to update the controller accounts of council members after they are already elected. I don't think you even need to include the election cycle number in this case.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That might be best., that's how we do it for the working group workers ->

async assignWorkerWellknownAccount(

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

There's no way to change a controller account for a member or councilor once set

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can do it via update_accounts extrinsic in the membership module

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

😃 good catch I have added the suggested fix + assertion

Comment thread tests/network-tests/src/fixtures/council/ElectCouncilFixture.ts Outdated
)

// change accounts to known accounts
const oldCouncilMemberAccounts = await this.getCouncilMembersControllerAccounts()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Instead of having to fetch those accounts here, you can query for the member's rootAccount in updateMemberControllerAccount, I think that will be simpler. (update_accounts extrinsic should be called using member's rootAccount, not controllerAccount, although in the integration tests they are usually the same)

Comment on lines +183 to +186
const newCouncilMemberAccounts = await this.api.updateCouncillorsAccounts(
oldCouncilMemberAccounts,
this.councilMembersIds
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

updateCouncillorsAccounts can query api.query.council.councilMembers, so that they don't need to be passed as an argument.

Ignazio Bovo and others added 2 commits February 16, 2023 08:53
Comment thread tests/network-tests/src/Api.ts Outdated
const debug = extendDebug('api-factory')
debug(`assigning Well Known Councillors Account`)
const newAccounts = memberIds.map((id) => {
const uri = `//Councillor//` + id.toString()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I noticed there is a small issue here. Because the uri starts with // and isFinalPath = false, the final uri becomes:

`${miniSecret}//testing////Councillor//${memberId}`

(notice 4 slashes before Councillor)

@Lezek123 Lezek123 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@mnaamani
mnaamani merged commit c3bd50e into Joystream:ephesus Feb 20, 2023
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