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

refactor: make solution extrinsic mortal #728

Merged
merged 3 commits into from
Dec 14, 2023
Merged

refactor: make solution extrinsic mortal #728

merged 3 commits into from
Dec 14, 2023

Conversation

niklasad1
Copy link
Member

Close #727

@niklasad1 niklasad1 requested a review from a team as a code owner December 13, 2023 17:19
nonce as u64,
Default::default(),
)?;
let signed_phase_len = client
Copy link
Member Author

Choose a reason for hiding this comment

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

NOTE: this is static applies the extrinsic to live for "signed_phase_len" and if for example the last block in the sign phase it will "live" for additional blocks.

We could change that as well but that is a slightly bigger change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I think this approximation is OK given that we also have the checks on the EPM side.

otoh, maybe it would be easier to know exactly the boundaries of the signed phase in on terms of block number if the Phase::Signed in EPM wrapped the block number when it started? That way the miner could fetch the current EPM phase and know mortal(signed_phase_started, signed_phase_len). is this worth the change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, indeed it requires some changes because each block is executed in its own async task and needs synchronization.

Lemme create another issue for it :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! I think for now this and the EPM-side changes are enough to tackle the original issue.

@niklasad1 niklasad1 requested a review from gpestana December 14, 2023 09:29
Copy link
Contributor

@gpestana gpestana left a comment

Choose a reason for hiding this comment

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

Added a comment regarding the approximation with number of blocks span of the tx and whether we could/should improve. Otherwise LGMT

nonce as u64,
Default::default(),
)?;
let signed_phase_len = client
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I think this approximation is OK given that we also have the checks on the EPM side.

otoh, maybe it would be easier to know exactly the boundaries of the signed phase in on terms of block number if the Phase::Signed in EPM wrapped the block number when it started? That way the miner could fetch the current EPM phase and know mortal(signed_phase_started, signed_phase_len). is this worth the change?

@niklasad1 niklasad1 merged commit 512eaff into main Dec 14, 2023
9 checks passed
@niklasad1 niklasad1 deleted the na-fix-727 branch December 14, 2023 11:21
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.

Consider adding reasonable mortality to submit extrinsic
3 participants