-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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(taiko-client): soft block driver APIs #18273
base: main
Are you sure you want to change the base?
Conversation
added |
This reverts commit 22346fb.
Co-authored-by: David <[email protected]>
Co-authored-by: David <[email protected]>
} | ||
|
||
var txListBytes []byte | ||
if s.rpc.L2.ChainID.Cmp(params.HeklaNetworkID) == 0 { |
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.
since we have this similiar code elsewhere it probably makes sense to just have a txListDecompressor.TryDecompress()
that takes a chainID, and does the comparison inside that function. I dont think we need two exported functions. They take the same parameters.
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.
Opened a PR here: #18444
new(big.Int).SetUint64(reqBody.TransactionBatch.BlockID), | ||
) | ||
if err != nil && err.Error() != ethereum.NotFound.Error() { | ||
return err |
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.
return err
should be
return c.JSON(http.StatusBadRequest, map[string]string{
"error": err.Error(),
})
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.
Changed
return c.JSON(http.StatusBadRequest, map[string]string{"error": "soft block has already been marked as ended"}) | ||
} | ||
if l1Origin.EndOfPreconf { | ||
return c.JSON(http.StatusBadRequest, map[string]string{ |
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.
maybe helper function for cleaner code, returnError(statusCode int, error string)
so we can just do
return c.JSON(statusCode, map[string]string{error}
once, i hate the look of all these repetetive inline maps. And then if we want we can add logging/etc within that function. idk.
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.
Added a returnError
helper method: 479711d
// @param either `end_of_block`, `end_of_preconf` or empty | ||
BatchMarker TransactionBatchMarker `json:"batchType"` | ||
// @param signature string Signature of this transaction batch | ||
Signature string `json:"signature"` |
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.
Signature string `json:"signature"` | |
Signature string `json:"signature" rlp:"-"` |
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.
Silence rlp encode and decode, so we don't need to copy the heavy struct at line59.
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.
Is this the same as passing an empty string here? Since the test here:
taiko-mono/packages/taiko-client/driver/driver_test.go
Lines 609 to 614 in f6860b5
payload, err := rlp.EncodeToBytes(txBatch) | |
s.Nil(err) | |
s.NotEmpty(payload) | |
sig, err := crypto.Sign(crypto.Keccak256(payload), preconferPrivKey) | |
s.Nil(err) |
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.
That's it!
Based on the latest design.
API preview: https://taikoxyz.github.io/taiko-mono/
taiko-geth changes: taikoxyz/taiko-geth#342