PowdrChip and PlonkChip

Note taken for PR review

PowdrChip and its traits

Defined in powdr_extension, probably follow the format of adding extension to openvm

as it follows the format of adding extension to openvm, which means it needs to implement some common traits, these are:

instruction_executor:

ChipUsageGetter

Chip

Analysing each trait

Instruction_executor:

The implementation of this trait for powdrChip is

This trait is for Runtime execution of the instruction.

in the implementation, firstly it get opcode from one of the input: instruction

let &Instruction { opcode, .. } = instruction;

then it compare if it is the same as the opcode from powdrChip itself.

assert_eq!(opcode.as_usize(), self.opcode.global_opcode().as_usize());

I guess each powdrOpcode is built from an offset of a opcode in global opcode.

Create New function

PowdrChip has these fields:

name, opcode, executor, air

The new function built like this:

air built from precompile.machine, and then put into Arc,

plonkChip’s air is from phantomdata, it is where air plonk compiler should be plugged in

Leave a Reply

Your email address will not be published. Required fields are marked *