-
Notifications
You must be signed in to change notification settings - Fork 38
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
remove check performed in the mempool #1708
Conversation
WalkthroughThe core change involves the removal of a gas check within the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ? TipsChat with CodeRabbit Bot (
|
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.
if err = e.service.SubmitTransaction(decryptedTx); err != nil { | ||
e.logger.Debug("Could not submit transaction", log.TxKey, decryptedTx.Hash(), log.ErrKey, 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.
The error handling for the SubmitTransaction
call within the SubmitTx
method logs the error but also returns an encrypted error response. It is crucial to ensure that the error returned does not leak sensitive information and that it is properly encrypted using the viewing key handler.
Confirm that the error encryption process is secure and that the error messages are generic enough to not reveal details that could be exploited by an attacker.
@@ -166,7 +166,7 @@ func (s *sequencer) createGenesisBatch(block *common.L1Block) error { | |||
|
|||
// produce batch #2 which has the message bus and any other system contracts | |||
cb, err := s.produceBatch( | |||
batch.Header.SequencerOrderNo.Add(batch.Header.SequencerOrderNo, big.NewInt(1)), | |||
big.NewInt(0).Add(batch.Header.SequencerOrderNo, big.NewInt(1)), |
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.
this was the major source of all flakyness.
This call was mutating the sequencer number of the first batch.
@@ -499,10 +499,6 @@ func (e *enclaveImpl) SubmitTx(tx common.EncryptedTx) (*responses.RawTx, common. | |||
if e.crossChainProcessors.Local.IsSyntheticTransaction(*decryptedTx) { | |||
return responses.AsPlaintextError(responses.ToInternalError(fmt.Errorf("synthetic transaction coming from external rpc"))), nil | |||
} | |||
if err = e.checkGas(decryptedTx); err != nil { |
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.
this check is performed again in the geth mempool, and returns better errors
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (2)
- go/enclave/enclave.go (2 hunks)
- go/enclave/nodetype/sequencer.go (1 hunks)
Additional comments: 1
go/enclave/nodetype/sequencer.go (1)
- 166-172: The logic for incrementing
SequencerOrderNo
in thecreateGenesisBatch
method has been changed to usebig.NewInt(0).Add(...)
instead ofbatch.Header.SequencerOrderNo.Add(...)
. This change should be functionally equivalent but ensure that it does not introduce any unintended side effects.
if e.crossChainProcessors.Local.IsSyntheticTransaction(*decryptedTx) { | ||
return responses.AsPlaintextError(responses.ToInternalError(fmt.Errorf("synthetic transaction coming from external rpc"))), nil | ||
} | ||
if err = e.checkGas(decryptedTx); err != nil { | ||
e.logger.Info("gas check failed", log.ErrKey, err.Error()) | ||
return responses.AsEncryptedError(err, vkHandler), nil | ||
} | ||
|
||
if err = e.service.SubmitTransaction(decryptedTx); err != nil { | ||
e.logger.Debug("Could not submit transaction", log.TxKey, decryptedTx.Hash(), log.ErrKey, 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.
The removal of the gas check logic in the SubmitTx
method aligns with the PR's objective to standardize error messages with Ethereum tooling. Ensure that the removal does not introduce any security or functional issues, especially considering that gas checks are a critical part of transaction validation in Ethereum-like networks.
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.
LGTM
Why this change is needed
PR checks pre-merging
Please indicate below by ticking the checkbox that you have read and performed the required
PR checks