forbole / flowJuno

Creative Commons Zero v1.0 Universal
2 stars 1 forks source link

getNodeTotalCommitment() not working when a validator has over 10000 delegators #1

Closed HarleyAppleChoi closed 3 years ago

HarleyAppleChoi commented 3 years ago

Bug description

The current getNodeTotalCommitment() rely on totalCommittedWithDelegators() at cadence main contract. When the specific validator has over 10000 validators, the cadence script fail to proceed because it exceed its computational limit.

Currently, the error is caught and ignored. However, flowJuno should be capable to calculate this on our side.

Steps to reproduce

For example, when I call with address 2cfab7e9163475282f67186b06ce6eea7fa0687d25dd9c7a84532f2016bc2e5ewhich has delegatorIDCounter = 11773

The cadence script return

ERROR: client: rpc error: code = Unknown desc = 3 errors occurred:
        * rpc error: code = Internal desc = failed to execute the script on the execution node execution-6c6af0933b710655ec553f4bead3b01c5e0a3ffd1194ee536efb926b356c54aa@flow-execution.samsungnext.com:3569=1000: rpc error: code = Internal desc = failed to execute script: failed to execute script at block (adfee3160efba032fa660226209204b56154901edf1956e2368184da719d7157): [Error Code: 1101] cadence runtime error Execution failed:
error: computation limited exceeded: 100000
   --> 8624b52f9ddcd04a.FlowIDTableStaking:375:16
HarleyAppleChoi commented 3 years ago

Solved