Ethereum
Database
- 트랜잭션 브로드캐스트
- 트랜잭션 싱크
- 모든 노드가 트랜잭션을 다 받을때까지 기다리지 않기 때문에 트랜잭션 풀은 일치하지 않는다.
EVM
- 트랜잭션 실행 VM.
- 어떻게 트랜잭션이 실행? (Input: tx, output: changed state)
- blockchain.go
- ApplyTransaction: attempts to apply a transaction to the given state database
- 검증. 메시지 생성. EVM 환경에 사용할 Context 생성. EVM 생성.
- ApplyMessage: computes the new state by applying the given message against the old state within the environment.
- TransitionDb: will transition the state by applying the current message and returning the evm execution result with following fields.
- correct nonce, enough balance, gas required in block 검사. intrinsic gas 빼기. accessList(EIP-2929), transient storage(EIP-1153) 준비.
- Execute: performs execution of the transaction according to the transaction type.
- evm.go: 컨트랙트 실행 후 bytecode, gasUsed and Status(success=1) 리턴.
- Call: executes the contract associated with the addr with the given input as parameters. It also handles any necessary value transfer required and takes the necessary steps to create accounts and reverses the state in case of an execution error or failed value transfer.
- run: runs the given contract and takes care of running precompiles with a fallback to the byte code interpreter.
PEVM
Prerequisite
-
Block-STM: a parallel execution engine for smart contract
-
Data hazard
-
problem: dependence on pipeline
-
solution: scoreboard
-
RAW
$R_2 = R_1 + R_3$ ( $R_2$ : Write )
$R_4 = R_2 + R_3$
-
WAW
$R_2 = R_1 + R_3$ ( $R_2$ : Write )
$R_2 = R_1 + R_4$
-
WAR
$R_2 = R_1 + R_3$ ( $R_3$ : Read )
$R_3 = R_1 + R_4$
-
Cosmos SDK: blockchain app framework, Tendermint: BFT consensus engine
[Optimistic Concurrency Control(OCC)](https://gebys.notion.site/Optimistic-Concurrency-Control-OCC-a2d30483f44143a6ba3b188c9d9a0c82)
RISECHAIN
risechain
https://medium.com/@rise_chain/rise-pevm-parallel-evm-bdfc4bc9f38e
Data Availability(DA): data needed for transactions and computations on the blockchain is available and can be accessed by nodes.