-
Notifications
You must be signed in to change notification settings - Fork 39
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
Validator nodes return error on tx submission #1792
Changes from 5 commits
389fcd5
4cd8dd5
fdb8097
9ca6b7d
7342f61
0a1ae98
ec074d9
c8e9932
61c14d5
6c870d5
4fc6f2d
28ddf00
9216dfb
e43a8a3
2016e42
cc98174
6c2e432
52526c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,10 @@ import ( | |
"math/big" | ||
"strings" | ||
|
||
// unsafe package imported in order to link to a private function in go-ethereum. | ||
// This allows us to validate transactions against the tx pool rules. | ||
_ "unsafe" | ||
|
||
gethlog "github.com/ethereum/go-ethereum/log" | ||
"github.com/ten-protocol/go-ten/go/common/log" | ||
|
||
|
@@ -78,6 +82,14 @@ func (t *TxPool) Add(transaction *common.L2Tx) error { | |
return nil | ||
} | ||
|
||
//go:linkname validateTxBasics github.com/ethereum/go-ethereum/core/txpool/legacypool.(*LegacyPool).validateTxBasics | ||
func validateTxBasics(_ *legacypool.LegacyPool, _ *types.Transaction, _ bool) error | ||
|
||
// Validate - run the underlying tx pool validation logic | ||
func (t *TxPool) Validate(tx *common.L2Tx) error { | ||
return validateTxBasics(t.legacyPool, tx, false) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will be hacky no matter how we do it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah fair enough. Not seen the |
||
} | ||
|
||
func (t *TxPool) Running() bool { | ||
return t.running | ||
} | ||
|
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.
Nitpick but I think this would read more naturally in Go if you flip it to let the happy path be the final return, like: