swanchain / go-computing-provider

A golang implementation of computing provider
MIT License
22 stars 23 forks source link

new scanner_service.go errors related to RPC? #140

Open ThomasBlock opened 1 month ago

ThomasBlock commented 1 month ago

My FCP is generally working fine now.

but there are periodically some strange errors. they appear over some hours, then there are no errors for some hours. i think its related to RPC.

SWAN_CHAIN_RPC = "https://mainnet-rpc01.swanchain.io"

level=error msg="503 Service Temporarily Unavailable: ..." func=Scan file="scanner_service.go:66" 

so i tried my own swan-node.. seems good but now different error:

SWAN_CHAIN_RPC = "http://127.0.0.1:8545"  

tail /opt/swan/log/node.log -f
t=2024-09-09T13:33:00+0000 lvl=info msg="Sync progress" reason="unsafe payload from sequencer" l2_finalized=0xc25b0439e492796797e6a88f035c28ec277ad95a934e26b9ff35e6ceebdcae5b:1448553 l2_safe=0xc25b0439e492796797e6a88f035c28ec277ad95a934e26b9ff35e6ceebdcae5b:1448553 l2_pending_safe=0xc25b0439e492796797e6a88f035c28ec277ad95a934e26b9ff35e6ceebdcae5b:1448553 l2_unsafe=0x6d541f4611aa6ce438035069e97482f3dd293bce8d2ace5d757b7cb801fc2aec:1449713 l2_backup_unsafe=0x0000000000000000000000000000000000000000000000000000000000000000:0 l2_time=1725888780 l1_derived=0x5834179463d5f2a39741e0e0d2b410138d03fd0370c6c5c07f73cd03d7312adb:20713369

tail /opt/swan/log/geth.log -f
INFO [09-09|13:33:20.565] Imported new potential chain segment     number=1,449,717 hash=8f8b6d..59c31a blocks=1    txs=1    mgas=0.044   elapsed=7.264ms       mgasps=6.033   snapdiffs=426.69KiB  triedirty=0.00B
INFO [09-09|13:33:20.567] Chain head was updated                   number=1,449,717 hash=8f8b6d..59c31a root=5a08ad..d8c698 elapsed=1.533442ms

cp log:
[5234.213ms] [rows:0] UPDATE t_job SET scanned_block=1421674 WHERE task_uuid='92572767-0d65-4d46-9803-2b6068bbc555'time="2024-09-08 00:36:33.726" level=error msg="save job 92572767-0d65-4d46-9803-2b6068bbc555 scanned block 1421674 err: database is locked" func=Scan file="scanner_service.go:85"
ThomasBlock commented 2 weeks ago

error still occurs @Normalnoise

[5057.546ms] [rows:0] UPDATEt_jobSETscanned_block=1677993 WHERE task_uuid='bfb0b248-3601-489d-8231-3e13c96a6a90'time="2024-09-22 20:36:27.072" level=error msg="save job bfb0b248-3601-489d-8231-3e13c96a6a90 scanned block 1677993 err: database is locked" func=Scan file="scanner_service.go:85"

sonic-chain commented 2 weeks ago

503, mainly errors that occur when using RPC to access chain data in a short period of time. Due to the retry mechanism, data will continue to be updated; database is locked has been fixed, and the lock timeout mechanism, the number of concurrent connections, and the change of synchronization data mode have been added.

ThomasBlock commented 2 weeks ago

503, mainly errors that occur when using RPC to access chain data in a short period of time. Due to the retry mechanism, data will continue to be updated; database is locked has been fixed, and the lock timeout mechanism, the number of concurrent connections, and the change of synchronization data mode have been added.

i use 0.6.4 and there are no recent commits to main.. hox can i access your mentioned fixes?

sonic-chain commented 2 weeks ago

you check v0.6.5, both db.go and scanner_service.go files have been modified.

ThomasBlock commented 2 weeks ago

oh thank you. hard to find as it's only a tag and not on release page

image

ThomasBlock commented 2 weeks ago

v0.6.5 looking good so far.