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
Add a cmd flag to allow locally submitted anchor transactions #614
Conversation
Co-authored-by: Donghwan Aidan Kwon <48199072+aidan-kwon@users.noreply.github.com>
cmd/utils/flags.go
Outdated
@@ -133,6 +133,10 @@ var ( | |||
Name: "txpool.nolocals", | |||
Usage: "Disables price exemptions for locally submitted transactions", | |||
} | |||
TxPoolAllowLocalAnchorTxFlag = cli.BoolFlag{ | |||
Name: "txpool.allowlocalanchortx", |
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.
txpool.allowlocalanchortx
looks confusing.. how about txpool.allow-local-anchortx
?
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.
Good. I will reflect.
blockchain/tx_pool.go
Outdated
@@ -54,6 +55,8 @@ var ( | |||
statsReportInterval = 8 * time.Second // Time interval to report transaction pool stats | |||
|
|||
txPoolIsFullErr = fmt.Errorf("txpool is full") | |||
|
|||
errNotAllowedTx = errors.New("not allowed tx") |
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.
errNotAllowedTx = errors.New("not allowed tx") | |
errNotAllowedTx = errors.New("locally anchoring chaindata tx is not allowed in this node") |
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.
@ehnuje I intended not to write the transaction type on this error for using commonly.
Instead of that, I added the tx type when the error is returned.
Please check 955 line.
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. It will be better if you fix linter failures.
OK I will. :) |
Proposed changes
This PR added
allowlocalanchortx
cmd flag makes txpool to allow locally submitted anchor transctions.For public endpoint node, it is necessary to prevent anchor transactions. So this option is added.
This PR reverted the feature is removed in #572.
Types of changes
Please put an x in the boxes related to your change.
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
$ make test
)Related issues
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...