Skip to content

stakerInfo fails due to bind.CallOpts type mismatch #1277

@Yashk767

Description

@Yashk767

Describe the bug

The stakerInfo command fails and causes the node to panic due to an incorrect argument type being passed to a contract call.

Specifically, the contract method is invoked via reflection with bind.CallOpts passed as a value, whereas the generated contract bindings expect a pointer type (*bind.CallOpts).
This type mismatch leads to a runtime panic during the reflective call execution.

Steps to Reproduce

docker exec -it razor-go razor stakerInfo --stakerId 6

Expected Behavior

The stakerInfo command should execute successfully without panicking and return valid staker information when a correct stakerId is provided.

Error Logs

{"CPUs":4,"Core":"6.8.0-57-generic","Operating System":"Linux","Platform":"unknown","go version":"go1.23.7","level":"info","msg":"","razor-go version":"2.1.1","time":"2025-10-27T19:31:46+02:00"}
{"address":"","blockNumber":null,"epoch":0,"level":"debug","msg":"Config: {Provider:https://mainnet.skalenodes.com/v1/elated-tan-skat GasMultiplier:1 BufferPercent:5 WaitTime:1 GasPrice:0 LogLevel:debug GasLimitOverride:30000000 GasLimitMultiplier:2 RPCTimeout:5 HTTPTimeout:5 LogFileMaxSize:200 LogFileMaxBackups:10 LogFileMaxAge:60}","time":"2025-10-27T19:31:46+02:00","version":"2.1.1"}
INFO[0000] Adding user-provided endpoint: https://mainnet.skalenodes.com/v1/elated-tan-skat
ERRO[0005] Error calculating metrics for endpoint https://skale-figment-8.skale.figment.io:10200: RPC call timed out: RPC call timed out: Post "https://skale-figment-8.skale.figment.io:10200": context deadline exceeded
INFO[0005] Best RPC endpoint updated: https://skale2.anonstake.com:10008 (BlockNumber: 21254420, Latency: 0.09)
{"address":"","blockNumber":null,"epoch":0,"level":"debug","msg":"Checking to assign log file...","time":"2025-10-27T19:31:51+02:00","version":"2.1.1"}
{"address":"","blockNumber":null,"epoch":0,"level":"debug","msg":"No `logFile` flag passed, not storing logs in any file","time":"2025-10-27T19:31:51+02:00","version":"2.1.1"}
{"address":"","blockNumber":null,"epoch":0,"level":"debug","msg":"ExecuteStakerinfo: StakerId:  6","time":"2025-10-27T19:31:51+02:00","version":"2.1.1"}
{"address":"","blockNumber":null,"epoch":0,"level":"debug","msg":"ExecuteStakerinfo: Calling GetStakerInfo() with argument stakerId =  6","time":"2025-10-27T19:31:51+02:00","version":"2.1.1"}
{"address":"","blockNumber":null,"epoch":0,"level":"debug","msg":"Blockchain function:  Stakers","time":"2025-10-27T19:31:51+02:00","version":"2.1.1"}
{"address":"","blockNumber":21254421,"epoch":3914636,"level":"debug","msg":"Blockchain function:  Maturities","time":"2025-10-27T19:31:51+02:00","version":"2.1.1"}
panic: reflect: Call using bind.CallOpts as type *bind.CallOpts

goroutine 174 [running]:
reflect.Value.call({0xee9000?, 0xc000012648?, 0xc000012648?}, {0xeede93, 0x4}, {0xc000588ea0, 0x2, 0x10a9a30?})
	/usr/local/go/src/reflect/value.go:440 +0x1b7f
reflect.Value.Call({0xee9000?, 0xc000012648?, 0x2?}, {0xc000588ea0?, 0x0?, 0x0?})
	/usr/local/go/src/reflect/value.go:368 +0xb9
razor/utils.InvokeFunctionWithTimeout.func1()
	/app/utils/struct-utils.go:71 +0x245
created by razor/utils.InvokeFunctionWithTimeout in goroutine 1
	/app/utils/struct-utils.go:65 +0x1a5

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions