-
Notifications
You must be signed in to change notification settings - Fork 70
concurrent processing of get blocks. batches by 50 default #181
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
Conversation
leovct
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, just a few comments regarding data races and channels :)
5fbfc70 to
dfa825b
Compare
leo changes Co-authored-by: Léo Vincent <[email protected]>
61f1fce to
f849992
Compare
leovct
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ ./polycli monitor --verbosity 700 --rpc-url https://polygon-rpc.com &> debug.txt
# it crashes after a few seconds
$ cat debug.txt
�[90m10:56AM�[0m �[35mTRC�[0m Starting logger in console mode
�[90m10:56AM�[0m �[33mDBG�[0m Using fake peer count �[36merror=�[0m�[31m"the method net_peerCount does not exist/is not available"�[0m
�[90m10:56AM�[0m �[33mDBG�[0m Fetching blocks �[36mChainID=�[0m137 �[36mGasPrice=�[0m93919755129 �[36mHeadBlock=�[0m52079176 �[36mPeerCount=�[0m0
�[90m10:56AM�[0m �[33mDBG�[0m Auto-adjusted batchSize to 200 based on cache limit
�[90m10:56AM�[0m �[33mDBG�[0m Redrawing �[36mBatchSize=�[0m200 �[36mChainID=�[0m137 �[36mGasPrice=�[0m93919755129 �[36mHeadBlock=�[0m52079176 �[36mLowerBlock=�[0m<nil> �[36mPeerCount=�[0m0 �[36mPendingCount=�[0m64165 �[36mTopDisplayedBlock=�[0m52079176 �[36mUpperBlock=�[0m<nil>
panic: close of closed channel
goroutine 48 [running]:
github.com/maticnetwork/polygon-cli/cmd/monitor.(*monitorStatus).processBatchesConcurrently.func1.1()
/Users/leovct/Documents/work/cli/polycli/cmd/monitor/monitor.go:321 +0x59
github.com/maticnetwork/polygon-cli/cmd/monitor.(*monitorStatus).processBatchesConcurrently.func1(0x0)
/Users/leovct/Documents/work/cli/polycli/cmd/monitor/monitor.go:353 +0x68f
created by github.com/maticnetwork/polygon-cli/cmd/monitor.(*monitorStatus).processBatchesConcurrently in goroutine 67
/Users/leovct/Documents/work/cli/polycli/cmd/monitor/monitor.go:317 +0xd1
leovct
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* concurrent processing of get blocks. batches by 50 default * fix error * lock on error value * leo comments * add lock * block info * Update cmd/monitor/monitor.go leo changes Co-authored-by: Léo Vincent <[email protected]> * final changes to monitor * fix: 0xPolygon/polygon-cli#181 (review) --------- Co-authored-by: Léo Vincent <[email protected]> Co-authored-by: John Hilliard <[email protected]>


some chains have limits for the max batch processing number. to solve this, concurrent fetching by batches in 50 is implemented.