Skip to content
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

Merged
merged 4 commits into from Aug 13, 2020

Conversation

KimKyungup
Copy link
Contributor

@KimKyungup KimKyungup commented Aug 12, 2020

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.

  • Bugfix
  • New feature or enhancement
  • Others

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.

  • I have read the CONTRIBUTING GUIDELINES doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Related issues

  • Please leave the issue numbers or links related to this PR here.

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...

cmd/utils/flags.go Outdated Show resolved Hide resolved
Co-authored-by: Donghwan Aidan Kwon <48199072+aidan-kwon@users.noreply.github.com>
aidan-kwon
aidan-kwon previously approved these changes Aug 12, 2020
@@ -133,6 +133,10 @@ var (
Name: "txpool.nolocals",
Usage: "Disables price exemptions for locally submitted transactions",
}
TxPoolAllowLocalAnchorTxFlag = cli.BoolFlag{
Name: "txpool.allowlocalanchortx",
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. I will reflect.

cmd/utils/flags.go Outdated Show resolved Hide resolved
@@ -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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
errNotAllowedTx = errors.New("not allowed tx")
errNotAllowedTx = errors.New("locally anchoring chaindata tx is not allowed in this node")

Copy link
Contributor Author

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.

aidan-kwon
aidan-kwon previously approved these changes Aug 13, 2020
Copy link
Member

@aidan-kwon aidan-kwon left a 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.

@KimKyungup
Copy link
Contributor Author

LGTM. It will be better if you fix linter failures.

OK I will. :)

@KimKyungup KimKyungup merged commit b911589 into klaytn:dev Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants