Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evm_decode_call fail #3

Open
arnaudbriche opened this issue Sep 19, 2024 · 2 comments
Open

evm_decode_call fail #3

arnaudbriche opened this issue Sep 19, 2024 · 2 comments

Comments

@arnaudbriche
Copy link
Contributor

Query

select evm_decode_call( 	evm_hex_decode('0xa9059cbb0000000000000000000000005e6cb68740e2ade791a083d19d339580d510948000000000000000000000000000000000000000000000000000000000065d7c70'), 	evm_hex_decode('0x0000000000000000000000000000000000000000000000000000000000000001'), 	'transfer(address to,uint256 value)(bool)' )

Error

time=2024-09-19T15:20:36.505+02:00 level=ERROR msg="PanicError(runtime error: index out of range [1] with length 1): goroutine 1 [running]:\nruntime/debug.Stack()\n\t/Users/didierfranc/go/pkg/mod/golang.org/[email protected]/src/runtime/debug/stack.go:26 +0x64\ngithub.com/agnosticeng/panicsafe.Defered(0x1400018dc90)\n\t/Users/didierfranc/go/pkg/mod/github.com/agnosticeng/[email protected]/panicsafe.go:26 +0x3c\npanic({0x102a1dae0?, 0x140000241f8?})\n\t/Users/didierfranc/go/pkg/mod/golang.org/[email protected]/src/runtime/panic.go:785 +0x124\ngithub.com/ClickHouse/ch-go/proto.ColStr.RowBytes(...)\n\t/Users/didierfranc/go/pkg/mod/github.com/!click!house/[email protected]/proto/col_str.go:99\ngithub.com/ClickHouse/ch-go/proto.ColBytes.Row({{{0x1400002a6a0, 0x20, 0x20}, {0x14000010ff0, 0x1, 0x1}}}, 0x0?)\n\t/Users/didierfranc/go/pkg/mod/github.com/!click!house/[email protected]/proto/col_str.go:178 +0xb0\ngithub.com/agnosticeng/agnostic-clickhouse-udf/cmd/function.Command.Command.func3(0x14000090880)\n\t/Users/didierfranc/dev/agnostic-clickhouse-udf/cmd/function/evm_decode_call/evm_decode_call.go:73 +0x3f0\ngithub.com/urfave/cli/v2.(*Command).Run(0x140001f02c0, 0x14000090880, {0x1400007ce60, 0x2, 0x2})\n\t/Users/didierfranc/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:276 +0x600\ngithub.com/urfave/cli/v2.(*Command).Run(0x140001f0580, 0x14000090740, {0x140000ab770, 0x3, 0x3})\n\t/Users/didierfranc/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:269 +0x83c\ngithub.com/urfave/cli/v2.(*Command).Run(0x140001f0840, 0x140000905c0, {0x140000200a0, 0x5, 0x5})\n\t/Users/didierfranc/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:269 +0x83c\ngithub.com/urfave/cli/v2.(*App).RunContext(0x140001ee000, {0x102a61d60, 0x102e5dd80}, {0x140000200a0, 0x5, 0x5})\n\t/Users/didierfranc/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:333 +0x51c\ngithub.com/urfave/cli/v2.(*App).Run(...)\n\t/Users/didierfranc/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:307\nmain.main.func2()\n\t/Users/didierfranc/dev/agnostic-clickhouse-udf/cmd/main.go:58 +0x48\ngithub.com/agnosticeng/panicsafe.Recover(0x102996760?)\n\t/Users/didierfranc/go/pkg/mod/github.com/agnosticeng/[email protected]/panicsafe.go:39 +0x54\nmain.main()\n\t/Users/didierfranc/dev/agnostic-clickhouse-udf/cmd/main.go:58 +0x1c8\n"
@arnaudbriche
Copy link
Contributor Author

arnaudbriche commented Dec 20, 2024

:) select evm_decode_call(evm_hex_decode('0xa9059cbb0000000000000000000000005e6cb68740e2ade791a083d19d339580d510948000000000000000000000000000000000000000000000000000000000065d7c70'), ^Ievm_hex_decode('0x0000000000000000000000000000000000000000000000000000000000000001'), ['transfer(address to,uint256 value)(bool)'])

SELECT evm_decode_call(evm_hex_decode('0xa9059cbb0000000000000000000000005e6cb68740e2ade791a083d19d339580d510948000000000000000000000000000000000000000000000000000000000065d7c70'), evm_hex_decode('0x0000000000000000000000000000000000000000000000000000000000000001'), ['transfer(address to,uint256 value)(bool)'])

Query id: 283c2b69-e247-46ae-9c3d-b530fc5e8c05


Elapsed: 0.174 sec.

Received exception:
Code: 302. DB::Exception: Child process was exited with return code 1: In scope SELECT evm_decode_call(evm_hex_decode('0xa9059cbb0000000000000000000000005e6cb68740e2ade791a083d19d339580d510948000000000000000000000000000000000000000000000000000000000065d7c70'), evm_hex_decode('0x0000000000000000000000000000000000000000000000000000000000000001'), ['transfer(address to,uint256 value)(bool)']). (CHILD_WAS_NOT_EXITED_NORMALLY)

But changing the fullsig from transfer(address to,uint256 value)(bool) to transfer(address to,uint256 value)(bool) works.

:) select evm_decode_call(evm_hex_decode('0xa9059cbb0000000000000000000000005e6cb68740e2ade791a083d19d339580d510948000000000000000000000000000000000000000000000000000000000065d7c70'), ^Ievm_hex_decode('0x0000000000000000000000000000000000000000000000000000000000000001'), ['transfer(address,uint256)(bool)'])

SELECT evm_decode_call(evm_hex_decode('0xa9059cbb0000000000000000000000005e6cb68740e2ade791a083d19d339580d510948000000000000000000000000000000000000000000000000000000000065d7c70'), evm_hex_decode('0x0000000000000000000000000000000000000000000000000000000000000001'), ['transfer(address,uint256)(bool)'])

Query id: f35685b5-4257-4024-9793-95ec3f3afcb2

   ┌─evm_decode_call(evm_hex_decode('0xa9059cbb0000000000000000000000005e6cb68740e2ade791a083d19d339580d510948000000000000000000000000000000000000000000000000000000000065d7c70'), evm_hex_decode('0x0000000000000000000000000000000000000000000000000000000000000001'), ['transfer(address,uint256)(bool)'])─┐
1. │ {"value":{"signature":"transfer(address,uint256)","inputs":{"arg0":"0x5e6cb68740e2ade791a083d19d339580d5109480","arg1":"106790000"},"outputs":{"arg0":true}}}                                                                                              │
   └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

1 row in set. Elapsed: 0.046 sec.

@arnaudbriche
Copy link
Contributor Author

evm_decode_calland evm_decode_event must handle more error by returning an Result(Error) instead of failing the whole process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant