EVM Traces

jaewon·2024년 11월 14일

날짜 : 2024-11-14 18:41

주제: #이더리움, #EVM


메모:

아래 json파일은 evm traces이다.

[ 
	{
		 "action": {
			 "from": "0x80b4f0bc53f620141c16bd209269aec0d72b22c4", 
			 "callType": "call",
			 "gas": "0x7a37",
			 "input": "0x",
			 "to": "0xde8bfd2b6e8f765710198fd10e7e87757b959f84",
			 "value": "0xb2ece213edb23a" 
		 },
		"blockHash": "0x985ab37352c3c8765c6f7b480e07e1eadef6dd53c06fa25cf72394cb8eae32b4",
		"blockNumber": 15095426,
		 "result": 
		 { "gasUsed": "0x2d4c",
		  "output": "0x" },
		"subtraces": 1,
		"traceAddress": [],
		"transactionHash": "0x0d13800319458a403500d407226328bbedbd8a10ff3d26a18c67872ac1f94ea7",
		 "transactionPosition": 420,
		 "type": "call" }, 

위 정보는 transaction receipt를 통해 접근할 수 있다.
substraces가 1인데, 이것은 위의 trace안에서 일어난 trace가 하나임을 의미한다.
즉 child trace가 하나 있음을 의미한다.
traceAddress가 비어있는 것은, 이것이 첫번째 trace임을 의미한다.

{ "action": 
		 { "from": "0xde8bfd2b6e8f765710198fd10e7e87757b959f84",
		  "callType": "call",
		  "gas": "0x8fc",
		  "input": "0x",
		  "to": "0xaf1931c20ee0c11bea17a41bfbbad299b2763bc0",
		  "value": "0xb2ece213edb23a" },
		  "blockHash": "0x985ab37352c3c8765c6f7b480e07e1eadef6dd53c06fa25cf72394cb8eae32b4",
		   "blockNumber": 15095426,
		  "result": { "gasUsed": "0x0", "output": "0x" },
		  "subtraces": 0,
		  "traceAddress": [ 0 ],
		  "transactionHash": "0x0d13800319458a403500d407226328bbedbd8a10ff3d26a18c67872ac1f94ea7",
		  "transactionPosition": 420,
		  "type": "call" } ]

위의 정보는 transaction receipt를 통해 접근 불가하고, traces를 통해서만 접근 가능하다.
type call을 통해 이 액션이 call을 통해 일어났음을 알 수 있다.
그 외에 create, suicide가 있다.

각각의 트랜잭션은 별개의 trace를 나타내고, 각 trace는 각 field를 가진다.
field는 대체로 transaction receipt와 비슷하고, 몇몇 additional 필드들이 있다.

Trace address

trace는 tree format으로 구성되어 있고, 첫번째는 [] 로 시작해서, 그 다음 레벨은 [0, [1]로 구성된다. 그 다음 레벨은 [0, 1], [1,1] 등으로 parent의 뒤에 추가된다.

출처(참고문헌)

연결문서

profile
블록체인, 암호학

0개의 댓글