Skip to content

Runtime interface for solution verification#1278

Merged
nazar-pc merged 3 commits intomainfrom
runtime-interface-for-solution-verification
Mar 22, 2023
Merged

Runtime interface for solution verification#1278
nazar-pc merged 3 commits intomainfrom
runtime-interface-for-solution-verification

Conversation

@nazar-pc
Copy link
Member

@nazar-pc nazar-pc commented Mar 21, 2023

This allows for runtime to verify solutions using host functions exposed by the client without embedding trusted setup parameters for KZG into runtime and saves a lot of computation when checking votes as the result.

It is not ideal, but this is the best thing I came up with to ensure we can author a block without timing out.

@i1i1 @ozgunozerk Check the latest commit, additional host functions need to be added to the client for this to work.

Fixes #1279

Code contributor checklist:

@nazar-pc nazar-pc force-pushed the runtime-interface-for-solution-verification branch from 2386fff to 02765d3 Compare March 21, 2023 21:14
@nazar-pc nazar-pc force-pushed the runtime-interface-for-solution-verification branch from 02765d3 to 02b3277 Compare March 21, 2023 21:15
@nazar-pc nazar-pc added breaking-consensus This PR introduces breaking changes to the consensus breaking-runtime This PR introduces breaking changes to the runtime and removed breaking-consensus This PR introduces breaking changes to the consensus labels Mar 21, 2023
Copy link
Contributor

@vedhavyas vedhavyas left a comment

Choose a reason for hiding this comment

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

Make sense to me over all. Some small details

liuchengxu
liuchengxu previously approved these changes Mar 22, 2023
Copy link
Contributor

@liuchengxu liuchengxu left a comment

Choose a reason for hiding this comment

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

LGTM


#[cfg(feature = "std")]
sp_externalities::decl_extension! {
/// An extension to verify the fraud proof.
Copy link
Contributor

Choose a reason for hiding this comment

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

:P

Suggested change
/// An extension to verify the fraud proof.
/// An extension to verify the solution.

vedhavyas
vedhavyas previously approved these changes Mar 22, 2023
Copy link
Contributor

@vedhavyas vedhavyas left a comment

Choose a reason for hiding this comment

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

Lgtm!

@nazar-pc nazar-pc dismissed stale reviews from vedhavyas and liuchengxu via 94db1f3 March 22, 2023 08:19
@nazar-pc nazar-pc force-pushed the runtime-interface-for-solution-verification branch from 02b3277 to 94db1f3 Compare March 22, 2023 08:19
@nazar-pc nazar-pc merged commit e0697cb into main Mar 22, 2023
@nazar-pc nazar-pc deleted the runtime-interface-for-solution-verification branch March 22, 2023 08:20
i1i1 added a commit to autonomys/subspace-pulsar-sdk that referenced this pull request Mar 22, 2023
i1i1 added a commit to autonomys/subspace-pulsar-sdk that referenced this pull request Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-runtime This PR introduces breaking changes to the runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Host functions exposing KZG crypto in a performant way (especially because we'll increase max degee and size of public parameters with it)

4 participants