Closed AbdelrahmanElawady closed 7 months ago
still missing reconnecting to chain urls for rpc errors in a round robin way
Connection error handling was added and tested with gdb
and calling manually shutdown()
syscall to simulate chain closing connection.
Description
This PR utilize listening to chain events to update relay cache with the latest twin information. For
TwinStored
andTwinUpdated
events, the event listener get twin information from the event and update local cache. For twins that are neither update nor created after starting events listener they will be fetched from the chain for the first time a request is made but will remain in cache forever until aTwinUpdated
is emitted then its data will be updated too.The time difference between clients calling
update_twin
and the blocks finalizing led to response failures for up to 6 seconds. So, to mitigate this delay a new optionalrelays
field was introduced to Envelope type. If set it will be considered the source of truth for which relays the twin is using and relays will update local cache based on that (even for federating messages).This removes all delay for twin updates (if using new field in envelope) and the need for cache warmer.
Issues
189