-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat(batcher): altda->ethda failover #24
base: feat--multiframe-altda-channel
Are you sure you want to change the base?
feat(batcher): altda->ethda failover #24
Conversation
324a34d
to
a86f871
Compare
a86f871
to
2d93832
Compare
@@ -130,6 +134,10 @@ func (s *FakeDAServer) HandleGet(w http.ResponseWriter, r *http.Request) { | |||
|
|||
func (s *FakeDAServer) HandlePut(w http.ResponseWriter, r *http.Request) { | |||
time.Sleep(s.putRequestLatency) | |||
if s.failoverCount > 0 { | |||
w.WriteHeader(http.StatusServiceUnavailable) | |||
s.failoverCount-- |
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.
should you return in this if block, instead of continuing to call HandlePut
?
@@ -154,6 +162,11 @@ func (s *FakeDAServer) SetGetRequestLatency(latency time.Duration) { | |||
s.getRequestLatency = latency | |||
} | |||
|
|||
// SetResponseStatusForNRequests sets the next n Put requests to return 503 status code. | |||
func (s *FakeDAServer) SetPutFailoverForNRequests(n uint64) { | |||
s.failoverCount = uint64(n) |
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.
unnecessary typecast
countEthDACommitment := uint64(0) | ||
|
||
// There is some nondeterministic timing behavior that affects whether the batcher has already | ||
// posted batches before seeing the abvoe SetPutFailoverForNRequests behavior change. |
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.
abvoe -> above
This PR builds on top of the feat--multiframe-altda-channel branch. Should merge that one first and then rebase on top.
It contains 2 commits:
Right now failover is done to calldata txs because that was trivial whereas failing over to blobs or their auto mode that switches between blobs and calldata would need a nontrivial refactor and some thinking. Not sure its worth putting effort into this atm given that the whole point of failover is that it should happen very rarely and also not last very long, but let me know if you guys think otherwise.