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 terms of use acceptance requirement #7527

Merged
merged 22 commits into from
Oct 15, 2020

Conversation

bidlocode
Copy link
Contributor

What type of PR is this?

Add terms of use acceptance requirement to beacon chain and validator process.

What does this PR do? Why is it needed?

  • Interactive input requiring user to write "accept"
  • --accept-terms-of-use flag for non-interactive environments
  • Record the acceptance to datadir so that users do not need to accept again.

@bidlocode bidlocode requested a review from a team as a code owner October 14, 2020 03:59
@bidlocode bidlocode changed the title Add accept tos Add terms of use acceptance requirement Oct 14, 2020
Comment on lines 115 to 121
// verify if ToS accepted
if accepted, err := tos.VerifyTosAcceptedOrPrompt(ctx); accepted != true {
if err != nil {
return err
}
return fmt.Errorf("you have to accept TERMS AND CONDITIONS in order to continue")
}
Copy link
Member

Choose a reason for hiding this comment

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

I know it's probably not possible in your current implementation, but it would be safer to handle these values individually. If VerifyTosAcceptedOrPrompt ever returned true and an error, then your check would happily accept it. This could happen by misuse or accidental changes in the future.

Better to be safe than sorry, I think!

Suggested change
// verify if ToS accepted
if accepted, err := tos.VerifyTosAcceptedOrPrompt(ctx); accepted != true {
if err != nil {
return err
}
return fmt.Errorf("you have to accept TERMS AND CONDITIONS in order to continue")
}
accepted, err := tos.VerifyTosAcceptedOrPrompt(ctx);
if err != nil {
return err
}
if !accepted {
return errors.New("you have to accept Terms and Conditions in order to continue")
}

Comment on lines 17 to 33
acceptTosPromptText = `
Prysmatic Labs

TERMS AND CONDITIONS: https://docs.prylabs.network/docs/licenses/prysmatic-labs

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

Type "yes" to accept this terms and conditions[yes/no]:`
)
Copy link
Member

Choose a reason for hiding this comment

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

We have some specific copy for this.
Let us get back to you with it, tomorrow.

@@ -317,6 +318,14 @@ contract in order to activate the validator client`,
app.Flags = appFlags

app.Before = func(ctx *cli.Context) error {
// verify if ToS accepted
if accepted, err := tos.VerifyTosAcceptedOrPrompt(ctx); accepted != true {
Copy link
Member

Choose a reason for hiding this comment

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

Same suggestion here please.

@prestonvanloon prestonvanloon added this to the v1.0.0-beta milestone Oct 14, 2020
@codecov
Copy link

codecov bot commented Oct 14, 2020

Codecov Report

Merging #7527 into master will decrease coverage by 0.03%.
The diff coverage is 47.82%.

@@            Coverage Diff             @@
##           master    #7527      +/-   ##
==========================================
- Coverage   61.71%   61.68%   -0.04%     
==========================================
  Files         421      422       +1     
  Lines       29479    29451      -28     
==========================================
- Hits        18193    18166      -27     
- Misses       8371     8373       +2     
+ Partials     2915     2912       -3     

@prestonvanloon
Copy link
Member

You need to add this flag for e2e as well:

@rauljordan
Copy link
Contributor

hi @bidlocode here are the terms of service. Please add it to a TERMS_OF_SERVICE.md file at the repo top-level and add a log that links users to that file:

Terms of Use

Effective as of Oct 14, 2020

By downloading, accessing or using the Prysm implementation (“Prysm”), you (referenced herein as “you” or the “user”) certify that you have read and agreed to the terms and conditions below (the “Terms”) which form a binding contract between you and Prysmatic Labs (referenced herein as “we” or “us”). If you do not agree to the Terms, do not download or use Prysm.

About Prysm

Prysm is a client implementation for Ethereum 2.0 Phase 0 protocol for a proof-of-stake blockchain. To participate in the network, a user must send ETH from Eth1.0 chain into a validator deposit contract, which will queue in the user as a validator in the system. Validators participate in proposing and voting on blocks in the protocol, and the network applies rewards/penalties based on their behavior. A detailed set of installation and usage instructions as well as breakdowns of each individual component are available in the official documentation portal, however, we do not warrant the accuracy, completeness or usefulness of this documentation. Any reliance you place on such information is strictly at your own risk.

Licensing Terms

Prysm is a fully open-source software program licensed pursuant to the GNU General Public License v3.0.

The Prysmatic Labs name, the term “Prysm” and all related names, logos, product and service names, designs and slogans are trademarks of Prysmatic Labs or its affiliates or licensors. You must not use such marks without our prior written permission.

Risks of Operating Prysm

The use of Prysm and acting as a validator on the Ethereum 2.0 network can lead to loss of money. Ethereum is still an experimental system and ETH remain a risky investment. You alone are responsible for your actions on Prysm including the security of your ETH and meeting any applicable minimum system requirements.

Use of Prysm and the ability to receive rewards or penalties may be affected at any time by mistakes made by the user or other users, software problems such as bugs, errors, incorrectly constructed transactions, unsafe cryptographic libraries or malware affecting the network, technical failures in the hardware of a user, security problems experienced by a user and/or actions or inactions of third parties and/or events experienced by third parties, among other risks. We cannot and do not guarantee that any user of Prysm will make money, that the Prysm network will operate in accordance with the documentation or that transactions will be effective or secure.

We make no claims that Prysm is appropriate or permitted for use in any specific jurisdiction. Access to Prysm may not be legal by certain persons or in certain jurisdictions or countries. If you access Prysm, you do so on your own initiative and are responsible for compliance with local laws.

Some Internet plans will charge an additional amount for any excess upload bandwidth used that isn’t included in the plan and may terminate your connection without warning because of overuse. We advise that you check whether your Internet connection is subjected to such limitations and monitor your bandwidth use so that you can stop Prysm before you reach your upload limit.

Warranty Disclaimer

PRYSM IS PROVIDED ON AN “AS-IS” BASIS AND MAY INCLUDE ERRORS, OMISSIONS, OR OTHER INACCURACIES. PRYSMATIC LABS AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT PRYSM FOR ANY PURPOSE, AND HEREBY EXPRESSLY DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT OR ANY OTHER IMPLIED WARRANTY UNDER THE UNIFORM COMPUTER INFORMATION TRANSACTIONS ACT AS ENACTED BY ANY STATE. WE ALSO MAKE NO REPRESENTATIONS OR WARRANTIES THAT PRYSM WILL OPERATE ERROR-FREE, UNINTERRUPTED, OR IN A MANNER THAT WILL MEET YOUR REQUIREMENTS AND/OR NEEDS. THEREFORE, YOU ASSUME THE ENTIRE RISK REGARDING THE QUALITY AND/OR PERFORMANCE OF PRYSM AND ANY TRANSACTIONS ENTERED INTO THEREON.

Limitation of Liability

In no event will Prysmatic Labs or any of its contributors be liable, whether in contract, warranty, tort (including negligence, whether active, passive or imputed), product liability, strict liability or other theory, breach of statutory duty or otherwise arising out of, or in connection with, your use of Prysm, for any direct, indirect, incidental, special or consequential damages (including any loss of profits or data, business interruption or other pecuniary loss, or damage, loss or other compromise of data, in each case whether direct, indirect, incidental, special or consequential) arising out of use Prysm, even if we or other users have been advised of the possibility of such damages. The foregoing limitations and disclaimers shall apply to the maximum extent permitted by applicable law, even if any remedy fails of its essential purpose. You acknowledge and agrees that the limitations of liability afforded us hereunder constitute a material and actual inducement and condition to entering into these Terms, and are reasonable, fair and equitable in scope to protect our legitimate interests in light of the fact that we are not receiving consideration from you for providing Prysm.

Indemnification

To the maximum extent permitted by law, you will defend, indemnify and hold Prysmatic Labs and its contributors harmless from and against any and all claims, actions, suits, investigations, or proceedings by any third party (including any party or purported party to or beneficiary or purported beneficiary of any transaction on Prysm), as well as any and all losses, liabilities,
damages, costs, and expenses (including reasonable attorneys’ fees) arising out of, accruing from, or in any way related to (i) your breach of the terms of this Agreement, (ii) any transaction, or the failure to occur of any transaction on Prysm, and (iii) your negligence, fraud, or willful misconduct.

Compliance with Laws and Tax Obligations

Your use of Prysm is subject to all applicable laws of any governmental authority, including, without limitation, federal, state and foreign securities laws, tax laws, tariff and trade laws, ordinances, judgments, decrees, injunctions, writs and orders or like actions of any governmental authority and rules, regulations, orders, interpretations, licenses, and permits of any federal,
regional, state, county, municipal or other governmental authority and you agree to comply with all such laws in your use of Prysm. The users of Prysm are solely responsible to determinate what, if any, taxes apply to their ETH transactions. The owners of, or contributors to, Prysm are not responsible for determining the taxes that apply to ETH transactions.

Miscellaneous

These Terms will be construed and enforced in accordance with the laws of the Illinois as applied to agreements entered into and completely performed in Illinois. You agree to the personal jurisdiction by and venue in Illinois and waive any objection to such jurisdiction or venue.

We reserve the right to revise these Terms, and your rights and obligations are at all times subject to the then-current Terms provided on Prysm. Your continued use of Prysm constitutes acceptance of such revised Terms.

These Terms constitute the entire agreement between you and Prysmatic Labs regarding use of Prysm and will supersede all prior agreements whether, written or oral. No usage of trade or other regular practice or method of dealing between the parties will be used to modify, interpret, supplement, or alter the terms of these Terms.

If any portion of these Terms is held invalid or unenforceable, such invalidity or enforceability will not affect the other provisions of these Terms, which will remain in full force and effect, and the invalid or unenforceable portion will be given effect to the greatest extent possible. The failure of a party to require performance of any provision will not affect that party’s right to require performance at any time thereafter, nor will a waiver of any breach or default of these Terms or any provision of these Terms constitute a waiver of any subsequent breach or default or a waiver of the provision itself.

prestonvanloon
prestonvanloon previously approved these changes Oct 14, 2020
@prestonvanloon prestonvanloon dismissed their stale review October 14, 2020 21:17

The flag does not work with validator.

Copy link
Member

@terencechain terencechain left a comment

Choose a reason for hiding this comment

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

I think we should add this to slasher/main.go just to be very safe

@prestonvanloon
Copy link
Member

I just tested this flag with the validator and I got this error.

ERRO[0000] flag provided but not defined: -accept-terms-of-use  prefix=main

@@ -203,6 +203,11 @@ var (
Usage: "Integer to define max recieve message call size (default: 4194304 (for 4MB))",
Value: 1 << 22,
}
// AcceptTosFlag specifies user acceptance of ToS for non-interactive environments
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// AcceptTosFlag specifies user acceptance of ToS for non-interactive environments
// AcceptTosFlag specifies user acceptance of ToS for non-interactive environments.

TERMS AND CONDITIONS: https://github.com/prysmaticlabs/prysm/blob/master/TERMS_OF_SERVICE.md


Type "accept" to accept this terms and conditions[accept/decline]:`
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Type "accept" to accept this terms and conditions[accept/decline]:`
Type "accept" to accept this terms and conditions [accept/decline]:`

log = logrus.WithField("prefix", "tos")
)

// VerifyTosAcceptedOrPrompt check if Tos was accepted before or asks to accept
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// VerifyTosAcceptedOrPrompt check if Tos was accepted before or asks to accept
// VerifyTosAcceptedOrPrompt check if Tos was accepted before or asks to accept.

@prestonvanloon
Copy link
Member

Please add the flag to the validator e2e flags

"--e2e-config",

and slasher e2e

"--e2e-config",

prestonvanloon
prestonvanloon previously approved these changes Oct 14, 2020
@@ -71,6 +71,7 @@ var appFlags = []cli.Flag{
flags.BeaconRPCProviderFlag,
flags.EnableHistoricalDetectionFlag,
flags.SpanCacheSize,
cmd.AcceptTosFlag,
}

Copy link
Member

Choose a reason for hiding this comment

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

I think we want to add VerifyTosAcceptedOrPrompt here as well

terencechain
terencechain previously approved these changes Oct 15, 2020
Copy link
Member

@terencechain terencechain left a comment

Choose a reason for hiding this comment

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

Thanks!

terencechain
terencechain previously approved these changes Oct 15, 2020
terencechain
terencechain previously approved these changes Oct 15, 2020
@prylabs-bulldozer prylabs-bulldozer bot merged commit 5f9ea35 into prysmaticlabs:master Oct 15, 2020
@bidlocode bidlocode deleted the add-accept-tos branch October 16, 2020 02:54
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

4 participants