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

complete KAS anchor feature (NEED TO REBASE THE LAST PR) #597

Closed
wants to merge 0 commits into from

Conversation

KimKyungup
Copy link
Contributor

Proposed changes

This PR is the last PR of KAS anchor feature.
Below works are included.

  • Add anchor into subbridge
  • Add KASAnchor API
  • change chainHEAD event to chainEvent for Anchoring
  • Add an exception of setting KASAnchoirPeriod

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

@KimKyungup
Copy link
Contributor Author

I will rebase this on the last PR.

Copy link
Contributor

@ehnuje ehnuje left a comment

Choose a reason for hiding this comment

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

What's the difference between this and #591?

@@ -287,6 +287,10 @@ func makeServiceChainConfig(ctx *cli.Context) (config sc.SCConfig) {
cfg.KASAnchor = ctx.GlobalBool(utils.KASServiceChainAnchorFlag.Name)
if cfg.KASAnchor {
cfg.KASAnchorPeriod = ctx.GlobalUint64(utils.KASServiceChainAnchorPeriodFlag.Name)
if cfg.KASAnchorPeriod == 0 {
cfg.KASAnchorPeriod = 1
logger.Warn("KAS anchor period is set by 1")
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
logger.Warn("KAS anchor period is set by 1")
logger.Warn("KAS anchor period is not given, KAS anchor period is set by 1")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This case is that user gives 0 for this option. :)

Copy link
Contributor

@ehnuje ehnuje Aug 10, 2020

Choose a reason for hiding this comment

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

Then the message should be something like below to notify the user that the anchor period can't be set as 0.

As KAS anchor period can't be set as 0, now KAS anchoring started with the period as 1

@@ -1012,6 +1012,11 @@ web3._extend({
call: 'subbridge_unsubscribeBridge',
params: 2
}),
new web3._extend.Method({
name: 'KASAnchor',
call: 'subbridge_kASAnchor',
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
call: 'subbridge_kASAnchor',
call: 'subbridge_kasAnchor',

Copy link
Contributor Author

Choose a reason for hiding this comment

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

subbridge_kASAnchor looks werid. But this is for subbridge.KASAnchor(). :)

@KimKyungup KimKyungup requested a review from ehnuje August 10, 2020 08:03
@ehnuje
Copy link
Contributor

ehnuje commented Aug 10, 2020

What's the difference between this and #591?

@KimKyungup Could you please check this comment?

@KimKyungup
Copy link
Contributor Author

KimKyungup commented Aug 11, 2020

@ehnuje I will rebase this. Before that time, please take a look d831362.

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

2 participants