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
But I think there is a need for an upper interface that will contain a lot of information.
for example, in evm, there is operation struct to contain more information about opcode.
typeoperationstruct {
// execute is the operation functionexecuteexecutionFunc// gasCost is the gas function and returns the gas required for executiongasCostgasFunc// validateStack validates the stack (size) for the operationvalidateStackstackValidationFunc// memorySize returns the memory size required for the operationmemorySizememorySizeFunchaltsbool// indicates whether the operation should halt further executionjumpsbool// indicates whether the program counter should not incrementwritesbool// determines whether this a state modifying operationvalidbool// indication whether the retrieved operation is valid and knownrevertsbool// determines whether the operation reverts state (implicitly halts)returnsbool// determines whether the operations sets the return data content
}
ExecutionFunc equal to koa's opcode Do(~~~) Function
Evm also uses stackValidationFunc to check the number of pops and puts in the stack to solve the stack function problem.
In addition, evm uses an operation set called jumptable to limit the operation set allowed by the config.
As of now, we only need to fetch a function that validates the stack.
I would like to add a struct that owns an opCode rather than merely putting a validateStack function in the opcode. (For future expansion)
I want to ask your thoughts.
The text was updated successfully, but these errors were encountered:
한글로도 첨부합니다... 영어를 잘 못쓰겠어서 전달이 잘 안될까봐..ㅜㅜ
evm에서는 instructionSet이라는것을 만들어 opcode와 함께 부가정보를 담아둡니다.
해당 정보에서 이 opcode를 실행시킬때 현재 stack에서 문제가 발생하는지 검증하는 함수와 가스정보 등을 같이 둡니다.
koa에서는 간단하게 하기위해 opcode라는 구조체에 함께 담아둘 수 있지만, 확장성을위해 evm처럼 operation이라는 구조체를 하나 만들어 opcode를 excute할수있고 다른 검증기능(스택 오류 나는지 여부 등)도 수행하는 상위 구조체를 만들면 좋을 것 같습니다.
koa have op codes in vm.go like
But I think there is a need for an upper interface that will contain a lot of information.
for example, in evm, there is operation struct to contain more information about opcode.
ExecutionFunc equal to koa's opcode
Do(~~~)
FunctionEvm also uses stackValidationFunc to check the number of pops and puts in the stack to solve the stack function problem.
In addition, evm uses an operation set called jumptable to limit the operation set allowed by the config.
As of now, we only need to fetch a function that validates the stack.
I would like to add a struct that owns an opCode rather than merely putting a validateStack function in the opcode. (For future expansion)
I want to ask your thoughts.
The text was updated successfully, but these errors were encountered: