You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would be nice if there was a way of setting the target instruction set (Ethereum fork version). It could look like this in the code:
#pragma target "cancun"
The pragma needs to apply to the whole program, so it should be an error if multiple targets are declared in a single program.
To implement this, opcode metadata in package internal/evm needs to be extended to track named instruction sets. I anticipate there will be a couple of these, and there could be support for more EVM versions than the Ethereum mainnet forks. So the best way of tracking these is probably as a tree, i.e.
type InstructionSet struct{
Name string
Parent string
NewOpcodes []string
RemovedOpcodes []string
}
var allInstructionSets map[string]*InstructionSet
When the user requests a named instruction set, the set of valid opcodes can be created by following the Parent references until the base Frontier instruction set is reached.
The text was updated successfully, but these errors were encountered:
fjl
changed the title
Targeting instruction sets
Targeting specific EVM instruction sets
Sep 13, 2023
Would be nice if there was a way of setting the target instruction set (Ethereum fork version). It could look like this in the code:
The pragma needs to apply to the whole program, so it should be an error if multiple targets are declared in a single program.
To implement this, opcode metadata in package internal/evm needs to be extended to track named instruction sets. I anticipate there will be a couple of these, and there could be support for more EVM versions than the Ethereum mainnet forks. So the best way of tracking these is probably as a tree, i.e.
When the user requests a named instruction set, the set of valid opcodes can be created by following the
Parent
references until the base Frontier instruction set is reached.The text was updated successfully, but these errors were encountered: