-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Update simulated geth client wrapper & LogPoller tests #13204
Update simulated geth client wrapper & LogPoller tests #13204
Conversation
…lient ( instead of deprecated backends.SimulatedBackendClient )
This test relied on markBlockFinalized() which has been replaced with finalizedBlocksThrough(). Just needed some slight adjustments to keep testing the same thing.
d5f0bb2
to
9be1d30
Compare
I see you updated files related to
|
74c13d9
to
81aa9b7
Compare
Add RegisterHeadNumberCallback() to SimulatedBackendClient, so we can trigger an rpc failover event just after reading a particular block, but before the logs get read for that block. This is the race condition that can happen on optimism chain which BackupPoller was designed to address
be613b7
to
aec7ffe
Compare
a5a60a5
to
fcae628
Compare
2
Outdated
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.
scratch file?
Presumably, the older verison of simulated.Backend would fill in fake timestamps instead of real ones?
The new Simulated Geth made two changes which affected this test 1. The automatic time interval added to each new block is now 1ns instead of 1s 2. AdjustTime() now automatically calls Commit() so it no longer needs to be called aftewards
- Consolidate go-ethereum imports - Remove extra geth-wrapper changes
fcae628
to
1a6e9ff
Compare
Present status:
I think the last one was what prompted me initially to run I'm not sure how many of these errors were already in the branch I'm trying to merge into, but seems like it might be about time to merge it and rebase that branch? |
core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt
Outdated
Show resolved
Hide resolved
…aside from the // error at the end that's in CI as well.
Quality Gate passedIssues Measures |
In this PR:
Update
SimulatedBackendClient
to wrap simulated.Backend & simulated.Client ( instead of deprecated backends.SimulatedBackendClient )Add
SetActiveClient()
toSimulatedBackendClient
to simulate switching from one rpc server to another while running.Add
RegisterHeadByNumberCallback
toSimulatedBackendCilent
, to register a custom callback function to be called each timeHeadByNumber()
is called.Add to
SimulateBackendClient
ability to run in "optimism mode", which behaves slightly different from geth: returns success rather than "block not found" ifFilterLogs()
is called with an invalid or unknown block hash.Update BackupPoller test to use the previous 3 features to simulate failing over.to an out-of-sync optimism rpc server during a race condition between pulling a particular block and its corresponding logs. (This is exactly the case which motivated the creation of Backup LogPoller.) This avoids the need to use rawdb, which is no longer accessible in geth.
Replace
markBlockAsFinalized()
andmarkBlockAsFinalizedByHash()
in LogPoller tests withfinalizeThroughBlock()
.Refactor logic in LogPoller tests previously using
markBlockAsFinalized(ByHash)
to make use offinalizedThroughBlock()
instead.Update some tests for new block timestamp behavior in Simulated Geth: automatic time increment between simulated blocks is 1ns now instead of 1s, and Client.AdjustTime() now automatically commits the current block after adjusting its timestamp
Update rest of tests in LogPoller and other packages to use new data types associated with (1.), instead of deprecated types