feat: rpc api key support with testnet readiness and performance improvements#7
Open
samclusker wants to merge 3 commits into
Open
feat: rpc api key support with testnet readiness and performance improvements#7samclusker wants to merge 3 commits into
samclusker wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
ABI compatibility — Coston / Coston2
Coston and Coston2 have received upgraded
VoterRegistryandFlareSystemsCalculatorcontractswith a different event ABI from the stable Songbird/Flare versions. Added
VoterRegistry_stable.jsonand
FlareSystemsCalculator_stable.jsonpreserving the Songbird/Flare ABI and updated the upgradedversions accordingly. Both sets of topic hashes are now registered at runtime so a single binary
handles all chains.
VoterRegistered.from_dictupdated to handle both the upgradedpublicKeystructand the stable flat fields.
Startup hang — Coston
get_unclaimed_rewardswas making a lot of sequential RPC calls in a triple-nested loop, withthe contract object re-instantiated on every iteration - observed blocked startup on a busy RPC. Fixed by:
asyncio.gatherwith aSemaphore(20)to avoid flooding the RPCtime.sleepin async contextBoth polling loops used
time.sleep(2)insideasync def observer_loop, blocking the entire eventloop and preventing aiohttp from running connection cleanup. Replaced with
await asyncio.sleep(2).Nonemedians — testnet onlyOn Coston/Coston2 some feeds occasionally receive no valid votes. The hard
assert median is not Noneis preserved on Songbird/Flare; on testnets a
DEBUGlog is emitted instead. Also fixed a latentcrash where an empty vote set would cause
max()to raise on an empty sequence.Added optional support for x-apikey to be used where needed.
WTxData.wrapped: TxDatawas never read — removed to avoid holding tx objects in memory per voting round - maybe was a cause of high mem usage/OOMKilled observed.KeyErrorraised immediately if the configured identity address is not in the signing policyFeel free to cherry pick these changes as you see fit - also happy to just roll with my own fork but thought I'd share some findings. 👍