안녕하세요.
크레이튼에서 블록 생성이 1초로 하는데 있어서 gas대신 computation cost를 기준으로 하고 있다고 알고 있습니다.
klay.estimateComputationCost는 결과값이 예측값이라곤하지만 조금 이해가 안되는 부분이 있습니다.
두개의 api 호출은 같은 작업을 하고 있는 것이고, 후자가 data field가 훨씬 큽니다. 그리고 gas 사용량도 훨씬 많구요. 근데 estimate computation cost는 오히려 후자꺼가 값이 더 적습니다. 이런 경우가 있나요?
트랜잭션의 computation cost를 정확히 알 수 있는 방법이 있나요?
아래는 실제로 api 호출 했을때의 입력값과 결과값들입니다. 참고 부탁드립니다.
1st 입력값:
klay.estimateComputationCost({to: ‘0x0f2963c07091ba12458a985e01d897d1ce75e499’,data: ‘0x6e7e1365000000000000000000000000000000000000000000000000000000000000010a1b168643562453ad9480400fe8c278b3f707a52dadc523457dfa74eebb706313000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001036fc7f2ba18bc2e412c981bd059b20e04f9740fb8083a5dd5173051409e023d15da78539f7a998dcce99887ad8d7afb51927f8826c479562fa96cb4c039f95823ab3d64fddf261a064587b137be657c234faeb6279d76e30d438f82ba51ff35201aef8ce2023dd18bfe63801a45b5940d36c66156a4e47067d3b7a9e7508688164980108a52b0686a412c7f4b3573d1ce9ae5d647946237c5fd99d68d8c6ce108bcf0e5f398a792236890596ec3ae1ca00d5f7e17362f48ff2adc7680ab5401266ae3dbdaf621b6f9dacee93b04105a4c3adb5d194afa5b70ece4ea2beb8cda07a7edd9a945ba9d6a44c8bee15a06f196bec49f8540b05cf7cf0d13dbfbedac00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000’})
1st 결과값: 0x5d8ba8
2nd 입력값:
klay.estimateComputationCost({to: ‘0x0f2963c07091ba12458a985e01d897d1ce75e499’,data: ‘0x6e7e1365000000000000000000000000000000000000000000000000000000000000010a053bfe916f97ad094da5e8bd69b9edfb4829da9cccfbf510f7b6a12474e7a38200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000118be7ce0a2b3d7a8a50f924416a429e18c0392ce32c70a87fc2e2203a5aca2bb0f61d139a7f3c5cd6c975e3e001a4b7ee6dc2e432c00e886f5b17239818fd7d11efd6c2b93f41541dcfde3dd7c01a9c2c50cc481a11ec94b0470ef7017e68ecf20cde5b7d38e449920c7da34215c000abc1700b57711b8f2ff5b44a060d1603a0ab6271e2bbb70d71291b920bd6fbc3de1aabcb892e7a0b79b1a6cc019dd643321a8f63faf0bfbbe513fe7756f9a5e522310ff2d0b0ab4174840deb75598e571017dad777f3a58c8d5eb34e547fcd34ae0ce823728cbeeb53ace78858d7083270c85771d9cc9fe0105c6d6fb8ba2831c34b6f170bfd116ca2983d185626ec20a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000380000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be40000000001030000010522540be4000000000000000000000000000000000000000000000000000000000000000001000000010a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000’})
2nd 결과값: 0x5c9d54