mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-10 05:47:59 -05:00
Compare commits
50 Commits
v1.0.0.rc.
...
v1.0.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b150acffca | ||
|
|
54a42ce4a8 | ||
|
|
9d174d5927 | ||
|
|
1b1b36497f | ||
|
|
04615cb97b | ||
|
|
b243665d3e | ||
|
|
654ef1afe5 | ||
|
|
0dbf5c4e63 | ||
|
|
c456dcdce8 | ||
|
|
10857223d0 | ||
|
|
4ef8a0f99e | ||
|
|
af0977b8d0 | ||
|
|
528272fc66 | ||
|
|
c5c868d0a6 | ||
|
|
622ab94465 | ||
|
|
ae8a619775 | ||
|
|
36b1eb66d5 | ||
|
|
639dcb028c | ||
|
|
edb40ddea4 | ||
|
|
0d2e3d978c | ||
|
|
29c6a0c42c | ||
|
|
aefa3e191a | ||
|
|
987205afc6 | ||
|
|
3ae4b793e6 | ||
|
|
600427bdb0 | ||
|
|
c7dd33431f | ||
|
|
0cf9800b75 | ||
|
|
3cc2ebc5d5 | ||
|
|
2cb814648a | ||
|
|
dc897a2007 | ||
|
|
a051e684ae | ||
|
|
64be627a6d | ||
|
|
6f766ed583 | ||
|
|
b0dfc46603 | ||
|
|
8c3faaa4c7 | ||
|
|
4c0db8bca4 | ||
|
|
0c5c246ee7 | ||
|
|
f871e1f3ef | ||
|
|
658dd95313 | ||
|
|
57fe012bc2 | ||
|
|
d62420b940 | ||
|
|
11bbea2562 | ||
|
|
2172cd60a6 | ||
|
|
2a546cc50b | ||
|
|
7d0031ee77 | ||
|
|
acf49fb38f | ||
|
|
26658a9f1f | ||
|
|
60d99c83eb | ||
|
|
98557e8f5e | ||
|
|
1ba747b3c9 |
218
.well-known/security.pub
Normal file
218
.well-known/security.pub
Normal file
@@ -0,0 +1,218 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
mQINBFpZUO0BEAC/tqN6QctJKSOF+A7jrBzvNvs6rVEi9Hn55u/scKNIPkSR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yUrS2d7cSeuNRWNlaRlnk3hZtB13xpmoHGYmrMOe7wiEE5xEnOju
|
||||
1ctRRRX6lNUPlSvID83Y9JSYL9hYMbidRmFY28AIddT/PjVTgfi1ABEBAAGJAjYE
|
||||
GAEIACAWIQQxfW6RBY+PPCMDundWMT5EWBKXpgUCXyHqUwIbDAAKCRBWMT5EWBKX
|
||||
poMOD/4/sRLnK94pY2qtSSfNZEumOdQVvges08u34saG4mT1iLD9TcRgsFvgwcTV
|
||||
Pec9Git4iJmoJpFylvOzoBWmtDzJ7TB3JxvtwUfFH2uZ22k12eChyAFHI8TxASqI
|
||||
TV2YwkIgB2PTmva1GrdNKM6y5bfS1BdS0u+Etgp4zN9nyQECY2sM2accUi2S7JBV
|
||||
7o6lEJWCRgFUwIfY6fdfxhZo/w0g2u5wftUQYlbXWSQLImFFZBc/13k8EMxsfbMi
|
||||
LQ/wxKEfe1ZwFoXqIS6cq8CHTdj70QO7K9ah6krGPmL23LVuxlkQIR7mT5yFJtv2
|
||||
VRT4IYgOUl6rAd08B6MOy6MOMa14FpNrAybPK8Yd/eSdUNciVf17q33Yc15x+trs
|
||||
En1hHbDS82xaLJ/Ld4mANeJVt3FodgVmzZGpKheFEOFXXeuX1ZZ4c9TgX+0wBKoh
|
||||
aBb8EGBVo4aV4GbZ/gEa8wls5NNTwd56H4G94hiq+qFM39x4YjhAvkM0hLRYzR05
|
||||
tSCdlEbkh2K6RbOhBPsNHCbypWRt2fN8/q4uLPJJt7NRQ2zi6H/x04HGblhXdX6H
|
||||
mmYjJv1LTbem9VptcpvPauNsibeIvIWA2nYM2ncDWt6gJpOH9Zh4fHuaG4aCdNmJ
|
||||
hPNeJNnmLcpDQvR9wU5w7e5tC/ZSeTZ5ul1zOKa1qZ4lJ50BDQ==
|
||||
=a30p
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
@@ -3,24 +3,23 @@ Hash: SHA512
|
||||
|
||||
Contact: mailto:security@prysmaticlabs.com
|
||||
Encryption: openpgp4fpr:0AE0051D647BA3C1A917AF4072E33E4DF1A5036E
|
||||
Encryption: openpgp4fpr:341396BAFACC28C5082327F889725027FC8EC0D4
|
||||
Encryption: openpgp4fpr:FEE44615A19049DF0CA0C2735E2B7E5734DFADCB
|
||||
Encryption: openpgp4fpr:CD08DE68C60B82D3EE2A3F7D95452A701810FEDB
|
||||
Encryption: openpgp4fpr:317D6E91058F8F3C2303BA7756313E44581297A6
|
||||
Preferred-Languages: en
|
||||
Canonical: https://github.com/prysmaticlabs/prysm/tree/master/.well-known/security.txt
|
||||
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQIzBAEBCgAdFiEECuAFHWR7o8GpF69AcuM+TfGlA24FAl6HrcwACgkQcuM+TfGl
|
||||
A26voQ/8DFB5wUHP0uyY8k7FGbxhLzSeImxomnUHJaUGfdczbCdYPMEHc9zI1iZP
|
||||
6LRiy9wS6qhqj/GSKVwvDPr+ZymXuV3L22GOP2lRhl7Z9Mm21ZJNOcoQBFOZnyHu
|
||||
DAy9HeTmeuJxYkf8weqZYXyzEoKJBDmfuWmEFjrtMcFXUfT3aJn1E2A/AQdcVQIC
|
||||
9L+iGWwFwjsPhcfaMuwcB7QMheDO6KSB7XPPCbrZ036Np8UTZ4qbZ5y73tlfkcOc
|
||||
tYTrMSPtS4eNutiDOP5Np36cLzRtNpm/BziAK+7ZKiYY0HI5h9IkCTLO4x2UmAMX
|
||||
sPoeaAB5z2QLIwmU9J2NhJrwiNMGTpJ+0bowy8U4cgzAX20CXVjRqGhy+cir8Ewg
|
||||
DjEGjWINUw6W0yzJp0mKSKzuOhdTTmzIYBeMBsyce+pgN1KGFCxeIwxGxyJzADdw
|
||||
mYQdljRXn4yEYP/KEpu/F2o8L4ptRO2jZWKvTvdzSSGGSyKyF4HsIRJ7m98DaB6S
|
||||
0oGq1KpbKKTbQi5g8UShGV2gPeMCs5ZIIqK2b/cRzUet18aUuofLmR4lkKZa9yEG
|
||||
rbzuJq/gB2vgQwExUEgVQ3/DfVc+y80e3YZ5s+rzV0vbLxl4Gh4yExpLo7hRf9iY
|
||||
EFvMzH+BEEb5VfCwByZyV1BmesZVIosr7K6UmVtPe0bZGvv3uIg=
|
||||
=5qpD
|
||||
iQIzBAEBCgAdFiEECuAFHWR7o8GpF69AcuM+TfGlA24FAl++klgACgkQcuM+TfGl
|
||||
A27rQw/6A29p1W20J0v+h218p8XWLSUpTIGLnZTxw6KqdyVXMzlsQK0YG4G2s2AB
|
||||
0LKh7Ae/Di5E0U+Z4AjUW5nc5eaCxK36GMscH9Ah0rgJwNYxEJw7/2o8ZqVT/Ip2
|
||||
+56rFihRqxFZfaCNKFVuZFaL9jKewV9FKYP38ID6/SnTcrOHiu2AoAlyZGmB03p+
|
||||
iT57SPRHatygeY4xb/gwcfREFWEv+VHGyBTv8A+6ABZDxyurboCFMERHzFICrbmk
|
||||
8UdHxxlWZDnHAbAUyAwpERC5znx6IHXQJwF8TMtu6XY6a6axT2XBOyJDF9/mZOz+
|
||||
kdkz6loX5uxaQBGLtTv6Kqf1yUGANOZ16VhHvWwL209LmHmigIVQ+qSM6c79PsW/
|
||||
vrsqdz3GBsiMC5Fq2vYgnbgzpfE8Atjn0y7E+j4R7IvwOAE/Ro/b++nqnc4YqhME
|
||||
P/yTcfGftaCrdSNnQCXeoV9JxpFM5Xy8KV3eexvNKbcgA/9DtgxL5i+s5ZJkUT9A
|
||||
+qJvoRrRyIym32ghkHgtFJKB3PLCdobeoOVRk6EnMo9zKSiSK2rZEJW8Ccbo515D
|
||||
W9qUOn3GF7lNVuUFAU/YKEdmDp/AVaViZ7vH+8aq0LC0HBkZ8XlzWnWoArS8sMhw
|
||||
fX0R9g/HMgrwNte/d0mwim5lJ2Plgv60Bh4grJqwZJeWbU0zi1U=
|
||||
=uW+X
|
||||
-----END PGP SIGNATURE-----
|
||||
|
||||
@@ -4,7 +4,7 @@ Note: The latest and most up to date documenation can be found on our [docs port
|
||||
|
||||
Excited by our work and want to get involved in building out our sharding releases? Or maybe you haven't learned as much about the Ethereum protocol but are a savvy developer?
|
||||
|
||||
You can explore our [Open Issues](https://github.com/prysmaticlabs/prysm/issues) in-the works for our different releases. Feel free to fork our repo and start creating PR’s after assigning yourself to an issue of interest. We are always chatting on [Discord](https://discord.gg/che9auJ) or [Gitter](https://gitter.im/prysmaticlabs/geth-sharding) drop us a line there if you want to get more involved or have any questions on our implementation!
|
||||
You can explore our [Open Issues](https://github.com/prysmaticlabs/prysm/issues) in-the works for our different releases. Feel free to fork our repo and start creating PR’s after assigning yourself to an issue of interest. We are always chatting on [Discord](https://discord.gg/CTYGPUJ) drop us a line there if you want to get more involved or have any questions on our implementation!
|
||||
|
||||
## Contribution Steps
|
||||
|
||||
@@ -62,12 +62,6 @@ Changes that only affect a single file can be tested with
|
||||
$ go test <file_you_are_working_on>
|
||||
```
|
||||
|
||||
Changes that affect multiple files can be tested with ...
|
||||
|
||||
```
|
||||
$ golangci-lint run && bazel test //...
|
||||
```
|
||||
|
||||
**10. Stage the file or files that you want to commit.**
|
||||
|
||||
```
|
||||
@@ -181,7 +175,7 @@ We consider two types of contributions to our repo and categorize them as follow
|
||||
|
||||
### Part-Time Contributors
|
||||
|
||||
Anyone can become a part-time contributor and help out on implementing sharding. The responsibilities of a part-time contributor include:
|
||||
Anyone can become a part-time contributor and help out on implementing eth2. The responsibilities of a part-time contributor include:
|
||||
|
||||
- Engaging in Gitter conversations, asking the questions on how to begin contributing to the project
|
||||
- Opening up github issues to express interest in code to implement
|
||||
@@ -192,8 +186,6 @@ Anyone can become a part-time contributor and help out on implementing sharding.
|
||||
- Follow up on open PRs
|
||||
- Have an estimated timeframe to completion and let the core contributors know if a PR will take longer than expected
|
||||
|
||||
We do not expect all part-time contributors to be experts on all the latest sharding documentation, but all contributors should at least be familiarized with our sharding [README.md](https://github.com/prysmaticlabs/prysm/blob/master/validator/README.md) and have gone through the required Ethereum readings as posted on our [READINGS.md](https://github.com/prysmaticlabs/prysm/blob/master/docs/READINGS.md) document.
|
||||
|
||||
### Core Contributors
|
||||
|
||||
Core contributors are remote contractors of Prysmatic Labs, LLC. and are considered critical team members of our organization. Core devs have all of the responsibilities of part-time contributors plus the majority of the following:
|
||||
|
||||
20
README.md
20
README.md
@@ -1,20 +1,28 @@
|
||||
# Prysm: An Ethereum 2.0 Client Written in Go
|
||||
# Prysm: An Ethereum 2.0 Implementation Written in Go
|
||||
|
||||
[](https://buildkite.com/prysmatic-labs/prysm)
|
||||
[](https://goreportcard.com/report/github.com/prysmaticlabs/prysm)
|
||||
[](https://github.com/ethereum/eth2.0-specs/tree/v1.0.0)
|
||||
[](https://discord.gg/KSA7rPr)
|
||||
[](https://discord.gg/CTYGPUJ)
|
||||
|
||||
This is the core repository for Prysm, a [Golang](https://golang.org/) implementation of the Ethereum 2.0 client specifications developed by [Prysmatic Labs](https://prysmaticlabs.com).
|
||||
This is the core repository for Prysm, a [Golang](https://golang.org/) implementation of the Ethereum 2.0 specification, developed by [Prysmatic Labs](https://prysmaticlabs.com).
|
||||
|
||||
### Getting Started
|
||||
A detailed set of installation and usage instructions as well as breakdowns of each individual component are available in the [official documentation portal](https://docs.prylabs.network). If you still have questions, feel free to stop by our [Discord](https://discord.gg/KSA7rPr).
|
||||
|
||||
### Come join the testnet!
|
||||
Participation is now open to the public for our Ethereum 2.0 phase 0 testnet release. Visit [prylabs.net](https://prylabs.net) for more information on the project or to sign up as a validator on the network. You can visualize the nodes in the network on [eth2stats.io](https://eth2stats.io), explore validator rewards/penalties via Bitfly's block explorer: [beaconcha.in](https://beaconcha.in), and follow the latest blocks added to the chain on [beaconscan](https://beaconscan.com).
|
||||
A detailed set of installation and usage instructions as well as breakdowns of each individual component are available in the [official documentation portal](https://docs.prylabs.network). If you still have questions, feel free to stop by our [Discord](https://discord.gg/CTYGPUJ).
|
||||
|
||||
### Staking on Mainnet
|
||||
|
||||
To participate in staking, you can join the [official eth2 launchpad](https://launchpad.ethereum.org). The launchpad is the only recommended way to become a validator on mainnet. You can visualize the nodes in the network on [eth2stats.io](https://eth2stats.io), explore validator rewards/penalties via Bitfly's block explorer: [beaconcha.in](https://beaconcha.in), and follow the latest blocks added to the chain on [beaconscan](https://beaconscan.com).
|
||||
|
||||
## Contributing
|
||||
|
||||
Want to get involved? Check out our [Contribution Guide](https://docs.prylabs.network/docs/contribute/contribution-guidelines/) to learn more!
|
||||
|
||||
## License
|
||||
|
||||
[GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html)
|
||||
|
||||
## Legal Disclaimer
|
||||
|
||||
[Terms of Use](/TERMS_OF_SERVICE.md)
|
||||
|
||||
43
TESTNET.md
43
TESTNET.md
@@ -1,43 +0,0 @@
|
||||
# Testnet
|
||||
|
||||
The Prysmatic Labs test network is available for anyone to join. The easiest way to participate is by joining through the website, https://prylabs.net.
|
||||
|
||||
## Interop
|
||||
|
||||
For developers looking to connect a client other than Prysm to the test network, here is the relevant information for compatability.
|
||||
|
||||
|
||||
**Spec version** - [v0.8.3](https://github.com/ethereum/eth2.0-specs/tree/v0.8.3)
|
||||
|
||||
**ETH 1 Deposit Contract Address** - See https://prylabs.net/contract. This contract is deployed on the [goerli](https://goerli.net/) network.
|
||||
|
||||
**Genesis time** - The ETH1 block time in which the 64th deposit to start ETH2 was included. This is NOT midnight of the next day as required by spec.
|
||||
|
||||
### ETH 2 Configuration
|
||||
|
||||
Use the [minimal config](https://github.com/ethereum/eth2.0-specs/blob/v0.8.3/configs/minimal.yaml) with the following changes.
|
||||
|
||||
| field | value |
|
||||
|-------|-------|
|
||||
| MIN_DEPOSIT_AMOUNT | 100 |
|
||||
| MAX_EFFECTIVE_BALANCE | 3.2 * 1e9 |
|
||||
| EJECTION_BALANCE | 1.6 * 1e9 |
|
||||
| EFFECTIVE_BALANCE_INCREMENT | 0.1 * 1e9 |
|
||||
| ETH1_FOLLOW_DISTANCE | 16 |
|
||||
| GENESIS_FORK_VERSION | See [latest code](https://github.com/prysmaticlabs/prysm/blob/master/shared/params/config.go#L236) |
|
||||
|
||||
These parameters reduce the minimal config to 1/10 of the required ETH.
|
||||
|
||||
We have a genesis.ssz file available for download [here](https://prysmaticlabs.com/uploads/genesis.ssz)
|
||||
|
||||
### Connecting to the network
|
||||
|
||||
We have a libp2p bootstrap node available at `/dns4/prylabs.net/tcp/30001/p2p/16Uiu2HAm7Qwe19vz9WzD2Mxn7fXd1vgHHp4iccuyq7TxwRXoAGfc`.
|
||||
|
||||
Some of the Prysmatic Labs hosted nodes are behind a libp2p relay, so your libp2p implementation protocol should understand this functionality.
|
||||
|
||||
### Other
|
||||
|
||||
Undoubtably, you will have bugs. Reach out to us on [Discord](https://discord.gg/KSA7rPr) and be sure to capture issues on Github at https://github.com/prysmaticlabs/prysm/issues.
|
||||
|
||||
If you have instructions for you client, we would love to attempt this on your behalf. Kindly send over the instructions via github issue, PR, email to team@prysmaticlabs.com, or discord.
|
||||
@@ -139,9 +139,9 @@ load(
|
||||
|
||||
container_pull(
|
||||
name = "alpine_cc_linux_amd64",
|
||||
digest = "sha256:3f7f4dfcb6dceac3a902f36609cc232262e49f5656a6dc4bb3da89e35fecc8a5",
|
||||
digest = "sha256:752aa0c9a88461ffc50c5267bb7497ef03a303e38b2c8f7f2ded9bebe5f1f00e",
|
||||
registry = "index.docker.io",
|
||||
repository = "fasibio/alpine-libgcc",
|
||||
repository = "pinglamb/alpine-glibc",
|
||||
)
|
||||
|
||||
container_pull(
|
||||
@@ -352,9 +352,9 @@ filegroup(
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
""",
|
||||
sha256 = "6bb16ff0dc9348090cc31a9ea453643d32b617e66ac6e7bb38985d530070631b",
|
||||
sha256 = "117f5366af9cf009354ed1abe02f906168158473461d69c8056984b9b0292619",
|
||||
urls = [
|
||||
"https://github.com/prysmaticlabs/prysm-web-ui/releases/download/0.0.2-alpha/prysm-web-ui.tar.gz",
|
||||
"https://github.com/prysmaticlabs/prysm-web-ui/releases/download/v1.0.0-beta.2/prysm-web-ui.tar.gz",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
# Prysmatic Labs Beacon Chain Implementation
|
||||
|
||||
This is the main project folder for the beacon chain implementation of Ethereum Serenity in Golang by [Prysmatic Labs](https://prysmaticlabs.com). Before you begin, check out our [Contribution Guidelines](https://github.com/prysmaticlabs/prysm/blob/master/CONTRIBUTING.md) and join our active chat room on Discord or Gitter below:
|
||||
This is the main project folder for the beacon chain implementation of eth2 written in Go by [Prysmatic Labs](https://prysmaticlabs.com).
|
||||
|
||||
[](https://discord.gg/KSA7rPr)
|
||||
[](https://gitter.im/prysmaticlabs/prysm?badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
You can also read our main [README](https://github.com/prysmaticlabs/prysm/blob/master/README.md) and join our active chat room on Discord.
|
||||
|
||||
Also, read the latest beacon chain [design spec](https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/beacon-chain.md), this design spec serves as a source of truth for the beacon chain implementation we follow at prysmatic labs.
|
||||
Check out the [FAQs](https://notes.ethereum.org/9MMuzWeFTTSg-3Tz_YeiBA?view). Refer this page on [why](http://email.mg2.substack.com/c/eJwlj9GOhCAMRb9G3jRQQPGBh5mM8xsbhKrsDGIAM9m_X9xN2qZtbpt7rCm4xvSjj5gLOTOmL-809CMbKXFaOKakIl4DZYr2AGyQIGjHOnWH22OiYnoIxmDijaBhhS6fcy7GvjobA9m0mSXOcnZq5GBqLkilXBZhBsus5ZK89VbKkRt-a-BZI6DzZ7iur1lQ953KJ9bemnxgahuQU9XJu6pFPdu8meT8vragzEjpMCwMGLlgLo6h5z1JumQTu4IJd4v15xqMf_8ZLP_Y1bSLdbnrD-LL71i2Kj7DLxaWWF4)
|
||||
we are combining sharding and casper together.
|
||||
[](https://discord.gg/CTYGPUJ)
|
||||
|
||||
Also, read the official beacon chain [specification](https://github.com/ethereum/eth2.0-specs/blob/master/specs/phase0/beacon-chain.md), this design spec serves as a source of truth for the beacon chain implementation we follow at Prysmatic Labs.
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
|
||||
@@ -99,6 +100,14 @@ func (s *Service) processAttestation(subscribedToStateEvents chan struct{}) {
|
||||
<-stateChannel
|
||||
stateSub.Unsubscribe()
|
||||
|
||||
if s.genesisTime.IsZero() {
|
||||
log.Warn("ProcessAttestations routine waiting for genesis time")
|
||||
for s.genesisTime.IsZero() {
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
||||
log.Warn("Genesis time received, now available to process attestations")
|
||||
}
|
||||
|
||||
st := slotutil.GetSlotTicker(s.genesisTime, params.BeaconConfig().SecondsPerSlot)
|
||||
for {
|
||||
select {
|
||||
|
||||
@@ -11,6 +11,7 @@ go_library(
|
||||
visibility = ["//beacon-chain:__subpackages__"],
|
||||
deps = [
|
||||
"//shared/cmd:go_default_library",
|
||||
"//shared/params:go_default_library",
|
||||
"@com_github_sirupsen_logrus//:go_default_library",
|
||||
"@com_github_urfave_cli_v2//:go_default_library",
|
||||
],
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
package flags
|
||||
|
||||
import (
|
||||
"github.com/prysmaticlabs/prysm/shared/params"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
@@ -17,7 +18,7 @@ var (
|
||||
DepositContractFlag = &cli.StringFlag{
|
||||
Name: "deposit-contract",
|
||||
Usage: "Deposit contract address. Beacon chain node will listen logs coming from the deposit contract to determine when validator is eligible to participate.",
|
||||
Value: "0x07b39F4fDE4A38bACe212b546dAc87C58DfE3fDC", // Medalla deposit contract address.
|
||||
Value: params.BeaconNetworkConfig().DepositContractAddress,
|
||||
}
|
||||
// RPCHost defines the host on which the RPC server should listen.
|
||||
RPCHost = &cli.StringFlag{
|
||||
@@ -69,7 +70,7 @@ var (
|
||||
Name: "grpc-gateway-corsdomain",
|
||||
Usage: "Comma separated list of domains from which to accept cross origin requests " +
|
||||
"(browser enforced). This flag has no effect if not used with --grpc-gateway-port.",
|
||||
Value: "http://localhost:4242,http://127.0.0.1:4242,http://localhost:4200",
|
||||
Value: "http://localhost:4200,http://localhost:7500,http://127.0.0.1:4200,http://127.0.0.1:7500,http://0.0.0.0:4200,http://0.0.0.0:7500",
|
||||
}
|
||||
// MinSyncPeers specifies the required number of successful peer handshakes in order
|
||||
// to start syncing with external peers.
|
||||
@@ -166,4 +167,10 @@ var (
|
||||
Name: "db-backup-output-dir",
|
||||
Usage: "Output directory for db backups",
|
||||
}
|
||||
// Eth1HeaderReqLimit defines a flag to set the maximum number of headers that a deposit log query can fetch. If none is set, 1000 will be the limit.
|
||||
Eth1HeaderReqLimit = &cli.Uint64Flag{
|
||||
Name: "eth1-header-req-limit",
|
||||
Usage: "Sets the maximum number of headers that a deposit log query can fetch.",
|
||||
Value: uint64(1000),
|
||||
}
|
||||
)
|
||||
|
||||
@@ -62,6 +62,7 @@ func (g *Gateway) Start() {
|
||||
ethpb.RegisterNodeHandler,
|
||||
ethpb.RegisterBeaconChainHandler,
|
||||
ethpb.RegisterBeaconNodeValidatorHandler,
|
||||
pbrpc.RegisterHealthHandler,
|
||||
}
|
||||
if g.enableDebugRPCEndpoints {
|
||||
handlers = append(handlers, pbrpc.RegisterDebugHandler)
|
||||
|
||||
@@ -57,6 +57,7 @@ var appFlags = []cli.Flag{
|
||||
flags.ChainID,
|
||||
flags.NetworkID,
|
||||
flags.WeakSubjectivityCheckpt,
|
||||
flags.Eth1HeaderReqLimit,
|
||||
cmd.MinimalConfigFlag,
|
||||
cmd.E2EConfigFlag,
|
||||
cmd.RPCMaxPageSizeFlag,
|
||||
|
||||
@@ -486,12 +486,13 @@ func (b *BeaconNode) registerPOWChainService() error {
|
||||
}
|
||||
|
||||
cfg := &powchain.Web3ServiceConfig{
|
||||
HTTPEndPoint: b.cliCtx.String(flags.HTTPWeb3ProviderFlag.Name),
|
||||
DepositContract: common.HexToAddress(depAddress),
|
||||
BeaconDB: b.db,
|
||||
DepositCache: b.depositCache,
|
||||
StateNotifier: b,
|
||||
StateGen: b.stateGen,
|
||||
HTTPEndPoint: b.cliCtx.String(flags.HTTPWeb3ProviderFlag.Name),
|
||||
DepositContract: common.HexToAddress(depAddress),
|
||||
BeaconDB: b.db,
|
||||
DepositCache: b.depositCache,
|
||||
StateNotifier: b,
|
||||
StateGen: b.stateGen,
|
||||
Eth1HeaderReqLimit: b.cliCtx.Uint64(flags.Eth1HeaderReqLimit.Name),
|
||||
}
|
||||
web3Service, err := powchain.NewService(b.ctx, cfg)
|
||||
if err != nil {
|
||||
@@ -507,7 +508,10 @@ func (b *BeaconNode) registerPOWChainService() error {
|
||||
}
|
||||
}
|
||||
if len(knownContract) > 0 && !bytes.Equal(cfg.DepositContract.Bytes(), knownContract) {
|
||||
return fmt.Errorf("database contract is %#x but tried to run with %#x", knownContract, cfg.DepositContract.Bytes())
|
||||
return fmt.Errorf("database contract is %#x but tried to run with %#x. This likely means "+
|
||||
"you are trying to run on a different network than what the database contains. You can run once with "+
|
||||
"'--clear-db' to wipe the old database or use an alternative data directory with '--datadir'",
|
||||
knownContract, cfg.DepositContract.Bytes())
|
||||
}
|
||||
|
||||
log.Infof("Deposit contract: %#x", cfg.DepositContract.Bytes())
|
||||
@@ -598,6 +602,8 @@ func (b *BeaconNode) registerRPCService() error {
|
||||
|
||||
host := b.cliCtx.String(flags.RPCHost.Name)
|
||||
port := b.cliCtx.String(flags.RPCPort.Name)
|
||||
beaconMonitoringHost := b.cliCtx.String(cmd.MonitoringHostFlag.Name)
|
||||
beaconMonitoringPort := b.cliCtx.Int(flags.MonitoringPortFlag.Name)
|
||||
cert := b.cliCtx.String(flags.CertFlag.Name)
|
||||
key := b.cliCtx.String(flags.KeyFlag.Name)
|
||||
mockEth1DataVotes := b.cliCtx.Bool(flags.InteropMockEth1DataVotesFlag.Name)
|
||||
@@ -607,6 +613,8 @@ func (b *BeaconNode) registerRPCService() error {
|
||||
rpcService := rpc.NewService(b.ctx, &rpc.Config{
|
||||
Host: host,
|
||||
Port: port,
|
||||
BeaconMonitoringHost: beaconMonitoringHost,
|
||||
BeaconMonitoringPort: beaconMonitoringPort,
|
||||
CertFlag: cert,
|
||||
KeyFlag: key,
|
||||
BeaconDB: b.db,
|
||||
|
||||
@@ -156,6 +156,7 @@ func NewService(ctx context.Context, cfg *Config) (*Service, error) {
|
||||
pubsub.WithNoAuthor(),
|
||||
pubsub.WithMessageIdFn(msgIDFunction),
|
||||
pubsub.WithSubscriptionFilter(s),
|
||||
pubsub.WithPeerOutboundQueueSize(256),
|
||||
}
|
||||
// Add gossip scoring options.
|
||||
if featureconfig.Get().EnablePeerScorer {
|
||||
|
||||
@@ -31,7 +31,7 @@ var (
|
||||
|
||||
const eth1LookBackPeriod = 100
|
||||
const eth1DataSavingInterval = 100
|
||||
const eth1HeaderReqLimit = 1000
|
||||
const defaultEth1HeaderReqLimit = uint64(1000)
|
||||
const depositlogRequestLimit = 10000
|
||||
|
||||
// Eth2GenesisPowchainInfo retrieves the genesis time and eth1 block number of the beacon chain
|
||||
@@ -276,7 +276,7 @@ func (s *Service) processPastLogs(ctx context.Context) error {
|
||||
}
|
||||
for currentBlockNum < latestFollowHeight {
|
||||
start := currentBlockNum
|
||||
end := currentBlockNum + eth1HeaderReqLimit
|
||||
end := currentBlockNum + s.eth1HeaderReqLimit
|
||||
// Appropriately bound the request, as we do not
|
||||
// want request blocks beyond the current follow distance.
|
||||
if end > latestFollowHeight {
|
||||
|
||||
@@ -149,16 +149,18 @@ type Service struct {
|
||||
runError error
|
||||
preGenesisState *stateTrie.BeaconState
|
||||
stateGen *stategen.State
|
||||
eth1HeaderReqLimit uint64
|
||||
}
|
||||
|
||||
// Web3ServiceConfig defines a config struct for web3 service to use through its life cycle.
|
||||
type Web3ServiceConfig struct {
|
||||
HTTPEndPoint string
|
||||
DepositContract common.Address
|
||||
BeaconDB db.HeadAccessDatabase
|
||||
DepositCache *depositcache.DepositCache
|
||||
StateNotifier statefeed.Notifier
|
||||
StateGen *stategen.State
|
||||
HTTPEndPoint string
|
||||
DepositContract common.Address
|
||||
BeaconDB db.HeadAccessDatabase
|
||||
DepositCache *depositcache.DepositCache
|
||||
StateNotifier statefeed.Notifier
|
||||
StateGen *stategen.State
|
||||
Eth1HeaderReqLimit uint64
|
||||
}
|
||||
|
||||
// NewService sets up a new instance with an ethclient when
|
||||
@@ -176,6 +178,11 @@ func NewService(ctx context.Context, config *Web3ServiceConfig) (*Service, error
|
||||
return nil, errors.Wrap(err, "could not setup genesis state")
|
||||
}
|
||||
|
||||
eth1HeaderReqLimit := config.Eth1HeaderReqLimit
|
||||
if eth1HeaderReqLimit == 0 {
|
||||
eth1HeaderReqLimit = defaultEth1HeaderReqLimit
|
||||
}
|
||||
|
||||
s := &Service{
|
||||
ctx: ctx,
|
||||
cancel: cancel,
|
||||
@@ -201,6 +208,7 @@ func NewService(ctx context.Context, config *Web3ServiceConfig) (*Service, error
|
||||
preGenesisState: genState,
|
||||
headTicker: time.NewTicker(time.Duration(params.BeaconConfig().SecondsPerETH1Block) * time.Second),
|
||||
stateGen: config.StateGen,
|
||||
eth1HeaderReqLimit: eth1HeaderReqLimit,
|
||||
}
|
||||
|
||||
eth1Data, err := config.BeaconDB.PowchainData(ctx)
|
||||
@@ -377,20 +385,38 @@ func (s *Service) dialETH1Nodes() (*ethclient.Client, *gethRPC.Client, error) {
|
||||
return nil, nil, err
|
||||
}
|
||||
httpClient := ethclient.NewClient(httpRPCClient)
|
||||
|
||||
// Add a method to clean-up and close clients in the event
|
||||
// of any connection failure.
|
||||
closeClients := func() {
|
||||
httpRPCClient.Close()
|
||||
httpClient.Close()
|
||||
}
|
||||
syncProg, err := httpClient.SyncProgress(s.ctx)
|
||||
if err != nil {
|
||||
closeClients()
|
||||
return nil, nil, err
|
||||
}
|
||||
if syncProg != nil {
|
||||
closeClients()
|
||||
return nil, nil, errors.New("eth1 node has not finished syncing yet")
|
||||
}
|
||||
// Make a simple call to ensure we are actually connected to a working node.
|
||||
cID, err := httpClient.ChainID(s.ctx)
|
||||
if err != nil {
|
||||
closeClients()
|
||||
return nil, nil, err
|
||||
}
|
||||
nID, err := httpClient.NetworkID(s.ctx)
|
||||
if err != nil {
|
||||
closeClients()
|
||||
return nil, nil, err
|
||||
}
|
||||
if cID.Uint64() != params.BeaconNetworkConfig().ChainID {
|
||||
closeClients()
|
||||
return nil, nil, fmt.Errorf("eth1 node using incorrect chain id, %d != %d", cID.Uint64(), params.BeaconNetworkConfig().ChainID)
|
||||
}
|
||||
if nID.Uint64() != params.BeaconNetworkConfig().NetworkID {
|
||||
closeClients()
|
||||
return nil, nil, fmt.Errorf("eth1 node using incorrect network id, %d != %d", nID.Uint64(), params.BeaconNetworkConfig().NetworkID)
|
||||
}
|
||||
|
||||
|
||||
@@ -504,3 +504,26 @@ func TestNewService_EarliestVotingBlock(t *testing.T) {
|
||||
assert.Equal(t, followBlock-conf.Eth1FollowDistance, blk, "unexpected earliest voting block")
|
||||
|
||||
}
|
||||
|
||||
func TestNewService_Eth1HeaderRequLimit(t *testing.T) {
|
||||
testAcc, err := contracts.Setup()
|
||||
require.NoError(t, err, "Unable to set up simulated backend")
|
||||
beaconDB, _ := dbutil.SetupDB(t)
|
||||
|
||||
s1, err := NewService(context.Background(), &Web3ServiceConfig{
|
||||
HTTPEndPoint: endpoint,
|
||||
DepositContract: testAcc.ContractAddr,
|
||||
BeaconDB: beaconDB,
|
||||
})
|
||||
require.NoError(t, err, "unable to setup web3 ETH1.0 chain service")
|
||||
assert.Equal(t, defaultEth1HeaderReqLimit, s1.eth1HeaderReqLimit, "default eth1 header request limit not set")
|
||||
|
||||
s2, err := NewService(context.Background(), &Web3ServiceConfig{
|
||||
HTTPEndPoint: endpoint,
|
||||
DepositContract: testAcc.ContractAddr,
|
||||
BeaconDB: beaconDB,
|
||||
Eth1HeaderReqLimit: uint64(150),
|
||||
})
|
||||
require.NoError(t, err, "unable to setup web3 ETH1.0 chain service")
|
||||
assert.Equal(t, uint64(150), s2.eth1HeaderReqLimit, "unable to set eth1HeaderRequestLimit")
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ func (bs *Server) StreamIndexedAttestations(
|
||||
}
|
||||
if data.Attestation == nil || data.Attestation.Aggregate == nil {
|
||||
// One nil attestation shouldn't stop the stream.
|
||||
log.Info("Indexed attestations stream got nil attestation or nil attestation aggregate")
|
||||
log.Debug("Indexed attestations stream got nil attestation or nil attestation aggregate")
|
||||
continue
|
||||
}
|
||||
bs.ReceivedAttestationsBuffer <- data.Attestation.Aggregate
|
||||
@@ -340,7 +340,7 @@ func (bs *Server) collectReceivedAttestations(ctx context.Context) {
|
||||
// We aggregate the received attestations, we know they all have the same data root.
|
||||
aggAtts, err := attaggregation.Aggregate(atts)
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Could not aggregate collected attestations")
|
||||
log.WithError(err).Error("Could not aggregate attestations")
|
||||
continue
|
||||
}
|
||||
if len(aggAtts) == 0 {
|
||||
@@ -356,7 +356,7 @@ func (bs *Server) collectReceivedAttestations(ctx context.Context) {
|
||||
case att := <-bs.ReceivedAttestationsBuffer:
|
||||
attDataRoot, err := att.Data.HashTreeRoot()
|
||||
if err != nil {
|
||||
log.Errorf("Could not hash tree root data: %v", err)
|
||||
log.Errorf("Could not hash tree root attestation data: %v", err)
|
||||
continue
|
||||
}
|
||||
attsByRoot[attDataRoot] = append(attsByRoot[attDataRoot], att)
|
||||
|
||||
@@ -38,7 +38,7 @@ func (bs *Server) ListBlocks(
|
||||
case *ethpb.ListBlocksRequest_Epoch:
|
||||
blks, _, err := bs.BeaconDB.Blocks(ctx, filters.NewFilter().SetStartEpoch(q.Epoch).SetEndEpoch(q.Epoch))
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Failed to get blocks: %v", err)
|
||||
return nil, status.Errorf(codes.Internal, "Could not get blocks: %v", err)
|
||||
}
|
||||
|
||||
numBlks := len(blks)
|
||||
@@ -194,12 +194,12 @@ func (bs *Server) StreamBlocks(_ *ptypes.Empty, stream ethpb.BeaconChain_StreamB
|
||||
}
|
||||
headState, err := bs.HeadFetcher.HeadState(bs.Ctx)
|
||||
if err != nil {
|
||||
log.WithError(err).WithField("blockSlot", data.SignedBlock.Block.Slot).Warn("Could not get head state to verify block signature")
|
||||
log.WithError(err).WithField("blockSlot", data.SignedBlock.Block.Slot).Error("Could not get head state")
|
||||
continue
|
||||
}
|
||||
|
||||
if err := blocks.VerifyBlockSignature(headState, data.SignedBlock); err != nil {
|
||||
log.WithError(err).WithField("blockSlot", data.SignedBlock.Block.Slot).Warn("Could not verify block signature")
|
||||
log.WithError(err).WithField("blockSlot", data.SignedBlock.Block.Slot).Error("Could not verify block signature")
|
||||
continue
|
||||
}
|
||||
if err := stream.Send(data.SignedBlock); err != nil {
|
||||
|
||||
@@ -358,7 +358,7 @@ func (is *infostream) generatePendingValidatorInfo(info *ethpb.ValidatorInfo) (*
|
||||
if deposit.block != nil {
|
||||
info.Status = ethpb.ValidatorStatus_DEPOSITED
|
||||
if queueTimestamp, err := is.depositQueueTimestamp(deposit.block); err != nil {
|
||||
log.WithError(err).Error("Failed to obtain queue activation timestamp")
|
||||
log.WithError(err).Error("Could not obtain queue activation timestamp")
|
||||
} else {
|
||||
info.TransitionTimestamp = queueTimestamp
|
||||
}
|
||||
@@ -415,7 +415,7 @@ func (is *infostream) calculateActivationTimeForPendingValidators(res []*ethpb.V
|
||||
for curEpoch := epoch + 1; len(sortedIndices) > 0 && len(pendingValidators) > 0; curEpoch++ {
|
||||
toProcess, err := helpers.ValidatorChurnLimit(numAttestingValidators)
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Failed to determine validator churn limit")
|
||||
log.WithError(err).Error("Could not determine validator churn limit")
|
||||
}
|
||||
if toProcess > uint64(len(sortedIndices)) {
|
||||
toProcess = uint64(len(sortedIndices))
|
||||
@@ -456,7 +456,7 @@ func (is *infostream) handleBlockProcessed() {
|
||||
is.currentEpoch = blockEpoch
|
||||
if err := is.sendValidatorsInfo(is.pubKeys); err != nil {
|
||||
// Client probably disconnected.
|
||||
log.WithError(err).Debug("Failed to send infostream response")
|
||||
log.WithError(err).Debug("Could not send infostream response")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ go_library(
|
||||
"//beacon-chain/db:go_default_library",
|
||||
"//beacon-chain/p2p:go_default_library",
|
||||
"//beacon-chain/sync:go_default_library",
|
||||
"//proto/beacon/rpc/v1:go_default_library",
|
||||
"//shared/version:go_default_library",
|
||||
"@com_github_gogo_protobuf//types:go_default_library",
|
||||
"@com_github_libp2p_go_libp2p_core//network:go_default_library",
|
||||
@@ -32,6 +33,7 @@ go_test(
|
||||
"//beacon-chain/p2p:go_default_library",
|
||||
"//beacon-chain/p2p/testing:go_default_library",
|
||||
"//beacon-chain/sync/initial-sync/testing:go_default_library",
|
||||
"//proto/beacon/rpc/v1:go_default_library",
|
||||
"//shared/bytesutil:go_default_library",
|
||||
"//shared/testutil:go_default_library",
|
||||
"//shared/testutil/assert:go_default_library",
|
||||
|
||||
@@ -17,6 +17,7 @@ import (
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/db"
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/p2p"
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/sync"
|
||||
pbrpc "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
|
||||
"github.com/prysmaticlabs/prysm/shared/version"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
@@ -27,13 +28,15 @@ import (
|
||||
// providing RPC endpoints for verifying a beacon node's sync status, genesis and
|
||||
// version information, and services the node implements and runs.
|
||||
type Server struct {
|
||||
SyncChecker sync.Checker
|
||||
Server *grpc.Server
|
||||
BeaconDB db.ReadOnlyDatabase
|
||||
PeersFetcher p2p.PeersProvider
|
||||
PeerManager p2p.PeerManager
|
||||
GenesisTimeFetcher blockchain.TimeFetcher
|
||||
GenesisFetcher blockchain.GenesisFetcher
|
||||
SyncChecker sync.Checker
|
||||
Server *grpc.Server
|
||||
BeaconDB db.ReadOnlyDatabase
|
||||
PeersFetcher p2p.PeersProvider
|
||||
PeerManager p2p.PeerManager
|
||||
GenesisTimeFetcher blockchain.TimeFetcher
|
||||
GenesisFetcher blockchain.GenesisFetcher
|
||||
BeaconMonitoringHost string
|
||||
BeaconMonitoringPort int
|
||||
}
|
||||
|
||||
// GetSyncStatus checks the current network sync status of the node.
|
||||
@@ -117,6 +120,13 @@ func (ns *Server) GetHost(_ context.Context, _ *ptypes.Empty) (*ethpb.HostData,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// GetLogsEndpoint
|
||||
func (ns *Server) GetLogsEndpoint(_ context.Context, _ *ptypes.Empty) (*pbrpc.LogsEndpointResponse, error) {
|
||||
return &pbrpc.LogsEndpointResponse{
|
||||
BeaconLogsEndpoint: fmt.Sprintf("%s:%d", ns.BeaconMonitoringHost, ns.BeaconMonitoringPort),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// GetPeer returns the data known about the peer defined by the provided peer id.
|
||||
func (ns *Server) GetPeer(_ context.Context, peerReq *ethpb.PeerRequest) (*ethpb.Peer, error) {
|
||||
pid, err := peer.Decode(peerReq.PeerId)
|
||||
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/p2p"
|
||||
mockP2p "github.com/prysmaticlabs/prysm/beacon-chain/p2p/testing"
|
||||
mockSync "github.com/prysmaticlabs/prysm/beacon-chain/sync/initial-sync/testing"
|
||||
pbrpc "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
|
||||
"github.com/prysmaticlabs/prysm/shared/bytesutil"
|
||||
"github.com/prysmaticlabs/prysm/shared/testutil"
|
||||
"github.com/prysmaticlabs/prysm/shared/testutil/assert"
|
||||
@@ -77,6 +78,19 @@ func TestNodeServer_GetVersion(t *testing.T) {
|
||||
assert.Equal(t, v, res.Version)
|
||||
}
|
||||
|
||||
func TestNodeServer_GetLogsEndpoint(t *testing.T) {
|
||||
ns := &Server{
|
||||
BeaconMonitoringHost: "localhost",
|
||||
BeaconMonitoringPort: 8080,
|
||||
}
|
||||
res, err := ns.GetLogsEndpoint(context.Background(), &ptypes.Empty{})
|
||||
require.NoError(t, err)
|
||||
want := &pbrpc.LogsEndpointResponse{
|
||||
BeaconLogsEndpoint: "localhost:8080",
|
||||
}
|
||||
assert.DeepEqual(t, want, res)
|
||||
}
|
||||
|
||||
func TestNodeServer_GetImplementedServices(t *testing.T) {
|
||||
server := grpc.NewServer()
|
||||
ns := &Server{
|
||||
|
||||
@@ -78,6 +78,8 @@ type Service struct {
|
||||
syncService chainSync.Checker
|
||||
host string
|
||||
port string
|
||||
beaconMonitoringHost string
|
||||
beaconMonitoringPort int
|
||||
listener net.Listener
|
||||
withCert string
|
||||
withKey string
|
||||
@@ -105,6 +107,8 @@ type Config struct {
|
||||
Port string
|
||||
CertFlag string
|
||||
KeyFlag string
|
||||
BeaconMonitoringHost string
|
||||
BeaconMonitoringPort int
|
||||
BeaconDB db.HeadAccessDatabase
|
||||
ChainInfoFetcher blockchain.ChainInfoFetcher
|
||||
HeadFetcher blockchain.HeadFetcher
|
||||
@@ -162,6 +166,8 @@ func NewService(ctx context.Context, cfg *Config) *Service {
|
||||
syncService: cfg.SyncService,
|
||||
host: cfg.Host,
|
||||
port: cfg.Port,
|
||||
beaconMonitoringHost: cfg.BeaconMonitoringHost,
|
||||
beaconMonitoringPort: cfg.BeaconMonitoringPort,
|
||||
withCert: cfg.CertFlag,
|
||||
withKey: cfg.KeyFlag,
|
||||
depositFetcher: cfg.DepositFetcher,
|
||||
@@ -250,13 +256,15 @@ func (s *Service) Start() {
|
||||
StateGen: s.stateGen,
|
||||
}
|
||||
nodeServer := &node.Server{
|
||||
BeaconDB: s.beaconDB,
|
||||
Server: s.grpcServer,
|
||||
SyncChecker: s.syncService,
|
||||
GenesisTimeFetcher: s.genesisTimeFetcher,
|
||||
PeersFetcher: s.peersFetcher,
|
||||
PeerManager: s.peerManager,
|
||||
GenesisFetcher: s.genesisFetcher,
|
||||
BeaconDB: s.beaconDB,
|
||||
Server: s.grpcServer,
|
||||
SyncChecker: s.syncService,
|
||||
GenesisTimeFetcher: s.genesisTimeFetcher,
|
||||
PeersFetcher: s.peersFetcher,
|
||||
PeerManager: s.peerManager,
|
||||
GenesisFetcher: s.genesisFetcher,
|
||||
BeaconMonitoringHost: s.beaconMonitoringHost,
|
||||
BeaconMonitoringPort: s.beaconMonitoringPort,
|
||||
}
|
||||
beaconChainServer := &beacon.Server{
|
||||
Ctx: s.ctx,
|
||||
@@ -298,6 +306,7 @@ func (s *Service) Start() {
|
||||
SyncChecker: s.syncService,
|
||||
}
|
||||
ethpb.RegisterNodeServer(s.grpcServer, nodeServer)
|
||||
pbrpc.RegisterHealthServer(s.grpcServer, nodeServer)
|
||||
ethpb.RegisterBeaconChainServer(s.grpcServer, beaconChainServer)
|
||||
ethpbv1.RegisterBeaconChainServer(s.grpcServer, beaconChainServerV1)
|
||||
if s.enableDebugRPCEndpoints {
|
||||
|
||||
@@ -39,6 +39,9 @@ func (vs *Server) StreamDuties(req *ethpb.DutiesRequest, stream ethpb.BeaconNode
|
||||
// If we are post-genesis time, then set the current epoch to
|
||||
// the number epochs since the genesis time, otherwise 0 by default.
|
||||
genesisTime := vs.GenesisTimeFetcher.GenesisTime()
|
||||
if genesisTime.IsZero() {
|
||||
return status.Error(codes.Unavailable, "genesis time is not set")
|
||||
}
|
||||
var currentEpoch uint64
|
||||
if genesisTime.Before(timeutils.Now()) {
|
||||
currentEpoch = slotutil.EpochsSinceGenesis(vs.GenesisTimeFetcher.GenesisTime())
|
||||
|
||||
@@ -64,7 +64,7 @@ func (vs *Server) GetAttestationData(ctx context.Context, req *ethpb.Attestation
|
||||
}
|
||||
defer func() {
|
||||
if err := vs.AttestationCache.MarkNotInProgress(req); err != nil {
|
||||
log.WithError(err).Error("Failed to mark cache not in progress")
|
||||
log.WithError(err).Error("Could not mark cache not in progress")
|
||||
}
|
||||
}()
|
||||
|
||||
@@ -89,7 +89,7 @@ func (vs *Server) GetAttestationData(ctx context.Context, req *ethpb.Attestation
|
||||
}
|
||||
}
|
||||
if headState == nil {
|
||||
return nil, status.Error(codes.Internal, "Failed to lookup parent state from head.")
|
||||
return nil, status.Error(codes.Internal, "Could not lookup parent state from head.")
|
||||
}
|
||||
|
||||
if helpers.CurrentEpoch(headState) < helpers.SlotToEpoch(req.Slot) {
|
||||
|
||||
@@ -192,12 +192,12 @@ func (vs *Server) eth1Data(ctx context.Context, slot uint64) (*ethpb.Eth1Data, e
|
||||
// Look up most recent block up to timestamp
|
||||
blockNumber, err := vs.Eth1BlockFetcher.BlockNumberByTimestamp(ctx, eth1VotingPeriodStartTime)
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Failed to get block number from timestamp")
|
||||
log.WithError(err).Error("Could not get block number from timestamp")
|
||||
return vs.randomETH1DataVote(ctx)
|
||||
}
|
||||
eth1Data, err := vs.defaultEth1DataResponse(ctx, blockNumber)
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Failed to get eth1 data from block number")
|
||||
log.WithError(err).Error("Could not get eth1 data from block number")
|
||||
return vs.randomETH1DataVote(ctx)
|
||||
}
|
||||
|
||||
@@ -237,12 +237,12 @@ func (vs *Server) eth1DataMajorityVote(ctx context.Context, beaconState *stateTr
|
||||
|
||||
lastBlockByEarliestValidTime, err := vs.Eth1BlockFetcher.BlockNumberByTimestamp(ctx, earliestValidTime)
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Failed to get last block by earliest valid time")
|
||||
log.WithError(err).Error("Could not get last block by earliest valid time")
|
||||
return vs.randomETH1DataVote(ctx)
|
||||
}
|
||||
timeOfLastBlockByEarliestValidTime, err := vs.Eth1BlockFetcher.BlockTimeByHeight(ctx, lastBlockByEarliestValidTime)
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Failed to get time of last block by earliest valid time")
|
||||
log.WithError(err).Error("Could not get time of last block by earliest valid time")
|
||||
return vs.randomETH1DataVote(ctx)
|
||||
}
|
||||
// Increment the earliest block if the original block's time is before valid time.
|
||||
@@ -253,12 +253,12 @@ func (vs *Server) eth1DataMajorityVote(ctx context.Context, beaconState *stateTr
|
||||
|
||||
lastBlockByLatestValidTime, err := vs.Eth1BlockFetcher.BlockNumberByTimestamp(ctx, latestValidTime)
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Failed to get last block by latest valid time")
|
||||
log.WithError(err).Error("Could not get last block by latest valid time")
|
||||
return vs.randomETH1DataVote(ctx)
|
||||
}
|
||||
timeOfLastBlockByLatestValidTime, err := vs.Eth1BlockFetcher.BlockTimeByHeight(ctx, lastBlockByLatestValidTime)
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Failed to get time of last block by latest valid time")
|
||||
log.WithError(err).Error("Could not get time of last block by latest valid time")
|
||||
return vs.randomETH1DataVote(ctx)
|
||||
}
|
||||
if timeOfLastBlockByLatestValidTime < earliestValidTime {
|
||||
@@ -278,7 +278,7 @@ func (vs *Server) eth1DataMajorityVote(ctx context.Context, beaconState *stateTr
|
||||
if lastBlockDepositCount >= vs.HeadFetcher.HeadETH1Data().DepositCount {
|
||||
hash, err := vs.Eth1BlockFetcher.BlockHashByHeight(ctx, lastBlockByLatestValidTime)
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Failed to get hash of last block by latest valid time")
|
||||
log.WithError(err).Error("Could not get hash of last block by latest valid time")
|
||||
return vs.randomETH1DataVote(ctx)
|
||||
}
|
||||
return ðpb.Eth1Data{
|
||||
@@ -507,7 +507,7 @@ func (vs *Server) canonicalEth1Data(
|
||||
|
||||
// Add in current vote, to get accurate vote tally
|
||||
if err := beaconState.AppendEth1DataVotes(currentVote); err != nil {
|
||||
return nil, nil, errors.Wrap(err, "failed to append eth1 data votes to state")
|
||||
return nil, nil, errors.Wrap(err, "could not append eth1 data votes to state")
|
||||
}
|
||||
hasSupport, err := blocks.Eth1DataHasEnoughSupport(beaconState, currentVote)
|
||||
if err != nil {
|
||||
|
||||
@@ -131,13 +131,13 @@ func (s *State) stateSummary(ctx context.Context, blockRoot [32]byte) (*pb.State
|
||||
}
|
||||
}
|
||||
if summary == nil {
|
||||
return s.recoverStateSummary(ctx, blockRoot)
|
||||
return s.RecoverStateSummary(ctx, blockRoot)
|
||||
}
|
||||
return summary, nil
|
||||
}
|
||||
|
||||
// This recovers state summary object of a given block root by using the saved block in DB.
|
||||
func (s *State) recoverStateSummary(ctx context.Context, blockRoot [32]byte) (*pb.StateSummary, error) {
|
||||
// RecoverStateSummary recovers state summary object of a given block root by using the saved block in DB.
|
||||
func (s *State) RecoverStateSummary(ctx context.Context, blockRoot [32]byte) (*pb.StateSummary, error) {
|
||||
if s.beaconDB.HasBlock(ctx, blockRoot) {
|
||||
b, err := s.beaconDB.Block(ctx, blockRoot)
|
||||
if err != nil {
|
||||
@@ -149,7 +149,7 @@ func (s *State) recoverStateSummary(ctx context.Context, blockRoot [32]byte) (*p
|
||||
}
|
||||
return summary, nil
|
||||
}
|
||||
return nil, errUnknownStateSummary
|
||||
return nil, errors.New("could not find block in DB")
|
||||
}
|
||||
|
||||
// This loads a beacon state from either the cache or DB then replay blocks up the requested block root.
|
||||
|
||||
@@ -232,7 +232,7 @@ func TestStateSummary_CanGetFromCacheOrDB(t *testing.T) {
|
||||
r := [32]byte{'a'}
|
||||
summary := &pb.StateSummary{Slot: 100}
|
||||
_, err := service.stateSummary(ctx, r)
|
||||
require.ErrorContains(t, errUnknownStateSummary.Error(), err)
|
||||
require.ErrorContains(t, "could not find block in DB", err)
|
||||
|
||||
service.stateSummaryCache.Put(r, summary)
|
||||
got, err := service.stateSummary(ctx, r)
|
||||
@@ -244,7 +244,7 @@ func TestStateSummary_CanGetFromCacheOrDB(t *testing.T) {
|
||||
r = [32]byte{'b'}
|
||||
summary = &pb.StateSummary{Root: r[:], Slot: 101}
|
||||
_, err = service.stateSummary(ctx, r)
|
||||
require.ErrorContains(t, errUnknownStateSummary.Error(), err)
|
||||
require.ErrorContains(t, "could not find block in DB", err)
|
||||
|
||||
require.NoError(t, service.beaconDB.SaveStateSummary(ctx, summary))
|
||||
got, err = service.stateSummary(ctx, r)
|
||||
|
||||
@@ -33,7 +33,7 @@ func SetStreamReadDeadline(stream network.Stream, duration time.Duration) {
|
||||
"peer": stream.Conn().RemotePeer(),
|
||||
"protocol": stream.Protocol(),
|
||||
"direction": stream.Stat().Direction,
|
||||
}).Debug("Failed to set stream deadline")
|
||||
}).Debug("Could not set stream deadline")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,6 @@ func SetStreamWriteDeadline(stream network.Stream, duration time.Duration) {
|
||||
"peer": stream.Conn().RemotePeer(),
|
||||
"protocol": stream.Protocol(),
|
||||
"direction": stream.Stat().Direction,
|
||||
}).Debug("Failed to set stream deadline")
|
||||
}).Debug("Could not set stream deadline")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,9 +53,9 @@ func ReadStatusCode(stream network.Stream, encoding encoder.NetworkEncoding) (ui
|
||||
func writeErrorResponseToStream(responseCode byte, reason string, stream libp2pcore.Stream, encoder p2p.EncodingProvider) {
|
||||
resp, err := createErrorResponse(responseCode, reason, encoder)
|
||||
if err != nil {
|
||||
log.WithError(err).Debug("Failed to generate a response error")
|
||||
log.WithError(err).Debug("Could not generate a response error")
|
||||
} else if _, err := stream.Write(resp); err != nil {
|
||||
log.WithError(err).Debugf("Failed to write to stream")
|
||||
log.WithError(err).Debugf("Could not write to stream")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +96,6 @@ func isValidStreamError(err error) bool {
|
||||
|
||||
func closeStream(stream network.Stream, log *logrus.Entry) {
|
||||
if err := helpers.FullClose(stream); err != nil && err.Error() != mux.ErrReset.Error() {
|
||||
log.WithError(err).Debug("Failed to reset stream")
|
||||
log.WithError(err).Debug("Could not reset stream")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,10 @@ const (
|
||||
noRequiredPeersErrRefreshInterval = 15 * time.Second
|
||||
// maxResetAttempts number of times stale FSM is reset, before backtracking is triggered.
|
||||
maxResetAttempts = 4
|
||||
// startBackSlots defines number of slots before the current head, which defines a start position
|
||||
// of the initial machine. This allows more robustness in case of normal sync sets head to some
|
||||
// orphaned block: in that case starting earlier and re-fetching blocks allows to reorganize chain.
|
||||
startBackSlots = 32
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -173,6 +177,9 @@ func (q *blocksQueue) loop() {
|
||||
|
||||
// Define initial state machines.
|
||||
startSlot := q.chain.HeadSlot()
|
||||
if startSlot > startBackSlots {
|
||||
startSlot -= startBackSlots
|
||||
}
|
||||
blocksPerRequest := q.blocksFetcher.blocksPerSecond
|
||||
for i := startSlot; i < startSlot+blocksPerRequest*lookaheadSteps; i += blocksPerRequest {
|
||||
q.smm.addStateMachine(i)
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/kevinms/leakybucket-go"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
@@ -1255,3 +1256,120 @@ func TestBlocksQueue_stuckInUnfavourableFork(t *testing.T) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestBlocksQueue_stuckWhenHeadIsSetToOrphanedBlock(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
beaconDB, _ := dbtest.SetupDB(t)
|
||||
p2p := p2pt.NewTestP2P(t)
|
||||
|
||||
chain := extendBlockSequence(t, []*eth.SignedBeaconBlock{}, 128)
|
||||
finalizedSlot := uint64(82)
|
||||
finalizedEpoch := helpers.SlotToEpoch(finalizedSlot)
|
||||
|
||||
genesisBlock := chain[0]
|
||||
require.NoError(t, beaconDB.SaveBlock(context.Background(), genesisBlock))
|
||||
genesisRoot, err := genesisBlock.Block.HashTreeRoot()
|
||||
require.NoError(t, err)
|
||||
|
||||
st := testutil.NewBeaconState()
|
||||
mc := &mock.ChainService{
|
||||
State: st,
|
||||
Root: genesisRoot[:],
|
||||
DB: beaconDB,
|
||||
FinalizedCheckPoint: ð.Checkpoint{
|
||||
Epoch: finalizedEpoch,
|
||||
Root: []byte(fmt.Sprintf("finalized_root %d", finalizedEpoch)),
|
||||
},
|
||||
}
|
||||
|
||||
// Populate database with blocks with part of the chain, orphaned block will be added on top.
|
||||
for _, blk := range chain[1:84] {
|
||||
parentRoot := bytesutil.ToBytes32(blk.Block.ParentRoot)
|
||||
// Save block only if parent root is already in database or cache.
|
||||
if beaconDB.HasBlock(ctx, parentRoot) || mc.HasInitSyncBlock(parentRoot) {
|
||||
require.NoError(t, beaconDB.SaveBlock(ctx, blk))
|
||||
require.NoError(t, st.SetSlot(blk.Block.Slot))
|
||||
}
|
||||
}
|
||||
require.Equal(t, uint64(83), mc.HeadSlot())
|
||||
require.Equal(t, chain[83].Block.Slot, mc.HeadSlot())
|
||||
|
||||
// Set head to slot 85, while we do not have block with slot 84 in DB, so block is orphaned.
|
||||
// Moreover, block with slot 85 is a forked block and should be replaced, with block from peer.
|
||||
orphanedBlock := testutil.NewBeaconBlock()
|
||||
orphanedBlock.Block.Slot = 85
|
||||
orphanedBlock.Block.StateRoot = testutil.Random32Bytes(t)
|
||||
require.NoError(t, beaconDB.SaveBlock(ctx, orphanedBlock))
|
||||
require.NoError(t, st.SetSlot(orphanedBlock.Block.Slot))
|
||||
require.Equal(t, uint64(85), mc.HeadSlot())
|
||||
|
||||
fetcher := newBlocksFetcher(
|
||||
ctx,
|
||||
&blocksFetcherConfig{
|
||||
chain: mc,
|
||||
p2p: p2p,
|
||||
db: beaconDB,
|
||||
},
|
||||
)
|
||||
fetcher.rateLimiter = leakybucket.NewCollector(6400, 6400, false)
|
||||
|
||||
// Connect peer that has all the blocks available.
|
||||
allBlocksPeer := connectPeerHavingBlocks(t, p2p, chain, finalizedSlot, p2p.Peers())
|
||||
defer func() {
|
||||
p2p.Peers().SetConnectionState(allBlocksPeer, peers.PeerDisconnected)
|
||||
}()
|
||||
|
||||
// Queue should be able to fetch whole chain (including slot which comes before the currently set head).
|
||||
queue := newBlocksQueue(ctx, &blocksQueueConfig{
|
||||
blocksFetcher: fetcher,
|
||||
chain: mc,
|
||||
highestExpectedSlot: uint64(len(chain) - 1),
|
||||
mode: modeNonConstrained,
|
||||
})
|
||||
|
||||
require.NoError(t, queue.start())
|
||||
isProcessedBlock := func(ctx context.Context, blk *eth.SignedBeaconBlock, blkRoot [32]byte) bool {
|
||||
finalizedSlot, err := helpers.StartSlot(mc.FinalizedCheckpt().Epoch)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
if blk.Block.Slot <= finalizedSlot || (beaconDB.HasBlock(ctx, blkRoot) || mc.HasInitSyncBlock(blkRoot)) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
select {
|
||||
case <-time.After(3 * time.Second):
|
||||
t.Fatal("test takes to long to complete")
|
||||
case data := <-queue.fetchedData:
|
||||
for _, blk := range data.blocks {
|
||||
blkRoot, err := blk.Block.HashTreeRoot()
|
||||
require.NoError(t, err)
|
||||
if isProcessedBlock(ctx, blk, blkRoot) {
|
||||
log.Errorf("slot: %d , root %#x: %v", blk.Block.Slot, blkRoot, errBlockAlreadyProcessed)
|
||||
continue
|
||||
}
|
||||
|
||||
parentRoot := bytesutil.ToBytes32(blk.Block.ParentRoot)
|
||||
if !beaconDB.HasBlock(ctx, parentRoot) && !mc.HasInitSyncBlock(parentRoot) {
|
||||
log.Errorf("%v: %#x", errParentDoesNotExist, blk.Block.ParentRoot)
|
||||
continue
|
||||
}
|
||||
|
||||
// Block is not already processed, and parent exists in database - process.
|
||||
require.NoError(t, beaconDB.SaveBlock(ctx, blk))
|
||||
require.NoError(t, st.SetSlot(blk.Block.Slot))
|
||||
}
|
||||
}
|
||||
require.NoError(t, queue.stop())
|
||||
|
||||
// Check that all blocks available in chain are produced by queue.
|
||||
for _, blk := range chain[:orphanedBlock.Block.Slot+32] {
|
||||
blkRoot, err := blk.Block.HashTreeRoot()
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, true, beaconDB.HasBlock(ctx, blkRoot) || mc.HasInitSyncBlock(blkRoot), "slot %d", blk.Block.Slot)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,13 +72,14 @@ func (s *Service) processPendingAtts(ctx context.Context) error {
|
||||
aggValid := s.validateAggregatedAtt(ctx, signedAtt) == pubsub.ValidationAccept
|
||||
if s.validateBlockInAttestation(ctx, signedAtt) && aggValid {
|
||||
if err := s.attPool.SaveAggregatedAttestation(att.Aggregate); err != nil {
|
||||
return err
|
||||
log.WithError(err).Debug("Could not save aggregate attestation")
|
||||
continue
|
||||
}
|
||||
s.setAggregatorIndexEpochSeen(att.Aggregate.Data.Target.Epoch, att.AggregatorIndex)
|
||||
|
||||
// Broadcasting the signed attestation again once a node is able to process it.
|
||||
if err := s.p2p.Broadcast(ctx, signedAtt); err != nil {
|
||||
log.WithError(err).Debug("Failed to broadcast")
|
||||
log.WithError(err).Debug("Could not broadcast")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -86,25 +87,34 @@ func (s *Service) processPendingAtts(ctx context.Context) error {
|
||||
// attestation's target intentionally reference checkpoint that's long ago.
|
||||
// Verify current finalized checkpoint is an ancestor of the block defined by the attestation's beacon block root.
|
||||
if err := s.chain.VerifyFinalizedConsistency(ctx, att.Aggregate.Data.BeaconBlockRoot); err != nil {
|
||||
return err
|
||||
log.WithError(err).Debug("Could not verify finalized consistency")
|
||||
continue
|
||||
}
|
||||
if err := s.chain.VerifyLmdFfgConsistency(ctx, att.Aggregate); err != nil {
|
||||
return err
|
||||
log.WithError(err).Debug("Could not verify FFG consistency")
|
||||
continue
|
||||
}
|
||||
preState, err := s.chain.AttestationPreState(ctx, att.Aggregate)
|
||||
if err != nil {
|
||||
return err
|
||||
log.WithError(err).Debug("Could not retrieve attestation prestate")
|
||||
continue
|
||||
}
|
||||
valid := s.validateUnaggregatedAttWithState(ctx, att.Aggregate, preState)
|
||||
if valid == pubsub.ValidationAccept {
|
||||
if err := s.attPool.SaveUnaggregatedAttestation(att.Aggregate); err != nil {
|
||||
return err
|
||||
log.WithError(err).Debug("Could not save unaggregated attestation")
|
||||
continue
|
||||
}
|
||||
s.setSeenCommitteeIndicesSlot(att.Aggregate.Data.Slot, att.Aggregate.Data.CommitteeIndex, att.Aggregate.AggregationBits)
|
||||
|
||||
valCount, err := helpers.ActiveValidatorCount(preState, helpers.SlotToEpoch(att.Aggregate.Data.Slot))
|
||||
if err != nil {
|
||||
log.WithError(err).Debug("Could not retrieve active validator count")
|
||||
continue
|
||||
}
|
||||
// Broadcasting the signed attestation again once a node is able to process it.
|
||||
if err := s.p2p.Broadcast(ctx, signedAtt); err != nil {
|
||||
log.WithError(err).Debug("Failed to broadcast")
|
||||
if err := s.p2p.BroadcastAttestation(ctx, helpers.ComputeSubnetForAttestation(valCount, signedAtt.Message.Aggregate), signedAtt.Message.Aggregate); err != nil {
|
||||
log.WithError(err).Debug("Could not broadcast")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,7 +122,7 @@ func (s *Service) processPendingAtts(ctx context.Context) error {
|
||||
log.WithFields(logrus.Fields{
|
||||
"blockRoot": hex.EncodeToString(bytesutil.Trunc(bRoot[:])),
|
||||
"pendingAttsCount": len(attestations),
|
||||
}).Info("Verified and saved pending attestations to pool")
|
||||
}).Debug("Verified and saved pending attestations to pool")
|
||||
|
||||
// Delete the missing block root key from pending attestation queue so a node will not request for the block again.
|
||||
s.pendingAttsLock.Lock()
|
||||
|
||||
@@ -36,7 +36,7 @@ func (s *Service) processPendingBlocksQueue() {
|
||||
runutil.RunEvery(s.ctx, processPendingBlocksPeriod, func() {
|
||||
locker.Lock()
|
||||
if err := s.processPendingBlocks(s.ctx); err != nil {
|
||||
log.WithError(err).Debug("Failed to process pending blocks")
|
||||
log.WithError(err).Debug("Could not process pending blocks")
|
||||
}
|
||||
locker.Unlock()
|
||||
})
|
||||
@@ -134,19 +134,27 @@ func (s *Service) processPendingBlocks(ctx context.Context) error {
|
||||
log.Debugf("Could not validate block from slot %d: %v", b.Block.Slot, err)
|
||||
s.setBadBlock(ctx, blkRoot)
|
||||
traceutil.AnnotateError(span, err)
|
||||
// In the next iteration of the queue, this block will be removed from
|
||||
// the pending queue as it has been marked as a 'bad' block.
|
||||
span.End()
|
||||
continue
|
||||
}
|
||||
|
||||
if err := s.chain.ReceiveBlock(ctx, b, blkRoot); err != nil {
|
||||
log.Debugf("Could not process block from slot %d: %v", b.Block.Slot, err)
|
||||
s.setBadBlock(ctx, blkRoot)
|
||||
traceutil.AnnotateError(span, err)
|
||||
// In the next iteration of the queue, this block will be removed from
|
||||
// the pending queue as it has been marked as a 'bad' block.
|
||||
span.End()
|
||||
continue
|
||||
}
|
||||
|
||||
s.setSeenBlockIndexSlot(b.Block.Slot, b.Block.ProposerIndex)
|
||||
|
||||
// Broadcasting the block again once a node is able to process it.
|
||||
if err := s.p2p.Broadcast(ctx, b); err != nil {
|
||||
log.WithError(err).Debug("Failed to broadcast block")
|
||||
log.WithError(err).Debug("Could not broadcast block")
|
||||
}
|
||||
|
||||
s.pendingQueueLock.Lock()
|
||||
|
||||
@@ -18,6 +18,7 @@ import (
|
||||
p2ptest "github.com/prysmaticlabs/prysm/beacon-chain/p2p/testing"
|
||||
p2ptypes "github.com/prysmaticlabs/prysm/beacon-chain/p2p/types"
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/state"
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/state/stategen"
|
||||
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
||||
"github.com/prysmaticlabs/prysm/shared/rand"
|
||||
"github.com/prysmaticlabs/prysm/shared/testutil"
|
||||
@@ -44,6 +45,7 @@ func TestRegularSyncBeaconBlockSubscriber_ProcessPendingBlocks1(t *testing.T) {
|
||||
slotToPendingBlocks: gcache.New(time.Second, 2*time.Second),
|
||||
seenPendingBlocks: make(map[[32]byte]bool),
|
||||
stateSummaryCache: stateSummaryCache,
|
||||
stateGen: stategen.New(db, stateSummaryCache),
|
||||
}
|
||||
err := r.initCaches()
|
||||
require.NoError(t, err)
|
||||
@@ -82,7 +84,9 @@ func TestRegularSyncBeaconBlockSubscriber_ProcessPendingBlocks1(t *testing.T) {
|
||||
// Insert bad b1 in the cache to verify the good one doesn't get replaced.
|
||||
require.NoError(t, r.insertBlockToPendingQueue(b1.Block.Slot, testutil.NewBeaconBlock(), [32]byte{}))
|
||||
|
||||
require.NoError(t, r.processPendingBlocks(context.Background()))
|
||||
require.NoError(t, r.processPendingBlocks(context.Background())) // Marks a block as bad
|
||||
require.NoError(t, r.processPendingBlocks(context.Background())) // Bad block removed on second run
|
||||
|
||||
assert.Equal(t, 1, len(r.slotToPendingBlocks.Items()), "Incorrect size for slot to pending blocks cache")
|
||||
assert.Equal(t, 2, len(r.seenPendingBlocks), "Incorrect size for seen pending block")
|
||||
}
|
||||
@@ -170,6 +174,7 @@ func TestRegularSyncBeaconBlockSubscriber_ProcessPendingBlocks_2Chains(t *testin
|
||||
slotToPendingBlocks: gcache.New(time.Second, 2*time.Second),
|
||||
seenPendingBlocks: make(map[[32]byte]bool),
|
||||
stateSummaryCache: stateSummaryCache,
|
||||
stateGen: stategen.New(db, stateSummaryCache),
|
||||
}
|
||||
err := r.initCaches()
|
||||
require.NoError(t, err)
|
||||
@@ -213,14 +218,19 @@ func TestRegularSyncBeaconBlockSubscriber_ProcessPendingBlocks_2Chains(t *testin
|
||||
require.NoError(t, r.insertBlockToPendingQueue(b4.Block.Slot, b4, b4Root))
|
||||
require.NoError(t, r.insertBlockToPendingQueue(b5.Block.Slot, b5, b5Root))
|
||||
|
||||
require.NoError(t, r.processPendingBlocks(context.Background()))
|
||||
require.NoError(t, r.processPendingBlocks(context.Background())) // Marks a block as bad
|
||||
require.NoError(t, r.processPendingBlocks(context.Background())) // Bad block removed on second run
|
||||
|
||||
assert.Equal(t, 2, len(r.slotToPendingBlocks.Items()), "Incorrect size for slot to pending blocks cache")
|
||||
assert.Equal(t, 2, len(r.seenPendingBlocks), "Incorrect size for seen pending block")
|
||||
|
||||
// Add b3 to the cache
|
||||
require.NoError(t, r.insertBlockToPendingQueue(b3.Block.Slot, b3, b3Root))
|
||||
require.NoError(t, r.db.SaveBlock(context.Background(), b3))
|
||||
require.NoError(t, r.processPendingBlocks(context.Background()))
|
||||
|
||||
require.NoError(t, r.processPendingBlocks(context.Background())) // Marks a block as bad
|
||||
require.NoError(t, r.processPendingBlocks(context.Background())) // Bad block removed on second run
|
||||
|
||||
assert.Equal(t, 1, len(r.slotToPendingBlocks.Items()), "Incorrect size for slot to pending blocks cache")
|
||||
assert.Equal(t, 3, len(r.seenPendingBlocks), "Incorrect size for seen pending block")
|
||||
|
||||
@@ -228,7 +238,10 @@ func TestRegularSyncBeaconBlockSubscriber_ProcessPendingBlocks_2Chains(t *testin
|
||||
require.NoError(t, r.insertBlockToPendingQueue(b2.Block.Slot, b2, b2Root))
|
||||
|
||||
require.NoError(t, r.db.SaveBlock(context.Background(), b2))
|
||||
require.NoError(t, r.processPendingBlocks(context.Background()))
|
||||
|
||||
require.NoError(t, r.processPendingBlocks(context.Background())) // Marks a block as bad
|
||||
require.NoError(t, r.processPendingBlocks(context.Background())) // Bad block removed on second run
|
||||
|
||||
assert.Equal(t, 0, len(r.slotToPendingBlocks.Items()), "Incorrect size for slot to pending blocks cache")
|
||||
assert.Equal(t, 4, len(r.seenPendingBlocks), "Incorrect size for seen pending block")
|
||||
}
|
||||
@@ -390,7 +403,7 @@ func TestService_BatchRootRequest(t *testing.T) {
|
||||
response := []*ethpb.SignedBeaconBlock{b2, b3, b4, b5}
|
||||
for _, blk := range response {
|
||||
_, err := stream.Write([]byte{responseCodeSuccess})
|
||||
assert.NoError(t, err, "Failed to write to stream")
|
||||
assert.NoError(t, err, "Could not write to stream")
|
||||
_, err = p2.Encoding().EncodeWithMaxLength(stream, blk)
|
||||
assert.NoError(t, err, "Could not send response back")
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ func (s *Service) registerRPC(baseTopic string, handle rpcHandler) {
|
||||
if err := handle(ctx, base, stream); err != nil {
|
||||
messageFailedProcessingCounter.WithLabelValues(topic).Inc()
|
||||
if err != p2ptypes.ErrWrongForkDigestVersion {
|
||||
log.WithError(err).Debug("Failed to handle p2p RPC")
|
||||
log.WithError(err).Debug("Could not handle p2p RPC")
|
||||
}
|
||||
traceutil.AnnotateError(span, err)
|
||||
}
|
||||
@@ -117,32 +117,32 @@ func (s *Service) registerRPC(baseTopic string, handle rpcHandler) {
|
||||
if err := s.p2p.Encoding().DecodeWithMaxLength(stream, msg.Interface()); err != nil {
|
||||
// Debug logs for goodbye/status errors
|
||||
if strings.Contains(topic, p2p.RPCGoodByeTopic) || strings.Contains(topic, p2p.RPCStatusTopic) {
|
||||
log.WithError(err).Debug("Failed to decode goodbye stream message")
|
||||
log.WithError(err).Debug("Could not decode goodbye stream message")
|
||||
traceutil.AnnotateError(span, err)
|
||||
return
|
||||
}
|
||||
log.WithError(err).Debug("Failed to decode stream message")
|
||||
log.WithError(err).Debug("Could not decode stream message")
|
||||
traceutil.AnnotateError(span, err)
|
||||
return
|
||||
}
|
||||
if err := handle(ctx, msg.Interface(), stream); err != nil {
|
||||
messageFailedProcessingCounter.WithLabelValues(topic).Inc()
|
||||
if err != p2ptypes.ErrWrongForkDigestVersion {
|
||||
log.WithError(err).Debug("Failed to handle p2p RPC")
|
||||
log.WithError(err).Debug("Could not handle p2p RPC")
|
||||
}
|
||||
traceutil.AnnotateError(span, err)
|
||||
}
|
||||
} else {
|
||||
msg := reflect.New(t)
|
||||
if err := s.p2p.Encoding().DecodeWithMaxLength(stream, msg.Interface()); err != nil {
|
||||
log.WithError(err).Debug("Failed to decode stream message")
|
||||
log.WithError(err).Debug("Could not decode stream message")
|
||||
traceutil.AnnotateError(span, err)
|
||||
return
|
||||
}
|
||||
if err := handle(ctx, msg.Elem().Interface(), stream); err != nil {
|
||||
messageFailedProcessingCounter.WithLabelValues(topic).Inc()
|
||||
if err != p2ptypes.ErrWrongForkDigestVersion {
|
||||
log.WithError(err).Debug("Failed to handle p2p RPC")
|
||||
log.WithError(err).Debug("Could not handle p2p RPC")
|
||||
}
|
||||
traceutil.AnnotateError(span, err)
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ func (s *Service) beaconBlocksByRangeRPCHandler(ctx context.Context, msg interfa
|
||||
defer span.End()
|
||||
defer func() {
|
||||
if err := stream.Close(); err != nil {
|
||||
log.WithError(err).Debug("Failed to close stream")
|
||||
log.WithError(err).Debug("Could not close stream")
|
||||
}
|
||||
}()
|
||||
ctx, cancel := context.WithTimeout(ctx, respTimeout)
|
||||
@@ -128,7 +128,7 @@ func (s *Service) writeBlockRangeToStream(ctx context.Context, startSlot, endSlo
|
||||
filter := filters.NewFilter().SetStartSlot(startSlot).SetEndSlot(endSlot).SetSlotStep(step)
|
||||
blks, roots, err := s.db.Blocks(ctx, filter)
|
||||
if err != nil {
|
||||
log.WithError(err).Debug("Failed to retrieve blocks")
|
||||
log.WithError(err).Debug("Could not retrieve blocks")
|
||||
s.writeErrorResponseToStream(responseCodeServerError, p2ptypes.ErrGeneric.Error(), stream)
|
||||
traceutil.AnnotateError(span, err)
|
||||
return err
|
||||
@@ -137,7 +137,7 @@ func (s *Service) writeBlockRangeToStream(ctx context.Context, startSlot, endSlo
|
||||
if startSlot == 0 {
|
||||
genBlock, genRoot, err := s.retrieveGenesisBlock(ctx)
|
||||
if err != nil {
|
||||
log.WithError(err).Debug("Failed to retrieve genesis block")
|
||||
log.WithError(err).Debug("Could not retrieve genesis block")
|
||||
s.writeErrorResponseToStream(responseCodeServerError, p2ptypes.ErrGeneric.Error(), stream)
|
||||
traceutil.AnnotateError(span, err)
|
||||
return err
|
||||
@@ -166,7 +166,7 @@ func (s *Service) writeBlockRangeToStream(ctx context.Context, startSlot, endSlo
|
||||
continue
|
||||
}
|
||||
if chunkErr := s.chunkWriter(stream, b); chunkErr != nil {
|
||||
log.WithError(chunkErr).Debug("Failed to send a chunked response")
|
||||
log.WithError(chunkErr).Debug("Could not send a chunked response")
|
||||
s.writeErrorResponseToStream(responseCodeServerError, p2ptypes.ErrGeneric.Error(), stream)
|
||||
traceutil.AnnotateError(span, chunkErr)
|
||||
return chunkErr
|
||||
|
||||
@@ -36,7 +36,7 @@ func (s *Service) sendRecentBeaconBlocksRequest(ctx context.Context, blockRoots
|
||||
func (s *Service) beaconBlocksRootRPCHandler(ctx context.Context, msg interface{}, stream libp2pcore.Stream) error {
|
||||
defer func() {
|
||||
if err := stream.Close(); err != nil {
|
||||
log.WithError(err).Debug("Failed to close stream")
|
||||
log.WithError(err).Debug("Could not close stream")
|
||||
}
|
||||
}()
|
||||
ctx, cancel := context.WithTimeout(ctx, ttfbTimeout)
|
||||
@@ -58,9 +58,9 @@ func (s *Service) beaconBlocksRootRPCHandler(ctx context.Context, msg interface{
|
||||
s.rateLimiter.add(stream, 1)
|
||||
resp, err := s.generateErrorResponse(responseCodeInvalidRequest, "no block roots provided in request")
|
||||
if err != nil {
|
||||
log.WithError(err).Debug("Failed to generate a response error")
|
||||
log.WithError(err).Debug("Could not generate a response error")
|
||||
} else if _, err := stream.Write(resp); err != nil {
|
||||
log.WithError(err).Debugf("Failed to write to stream")
|
||||
log.WithError(err).Debugf("Could not write to stream")
|
||||
}
|
||||
return errors.New("no block roots provided")
|
||||
}
|
||||
@@ -68,9 +68,9 @@ func (s *Service) beaconBlocksRootRPCHandler(ctx context.Context, msg interface{
|
||||
if uint64(len(blockRoots)) > params.BeaconNetworkConfig().MaxRequestBlocks {
|
||||
resp, err := s.generateErrorResponse(responseCodeInvalidRequest, "requested more than the max block limit")
|
||||
if err != nil {
|
||||
log.WithError(err).Debug("Failed to generate a response error")
|
||||
log.WithError(err).Debug("Could not generate a response error")
|
||||
} else if _, err := stream.Write(resp); err != nil {
|
||||
log.WithError(err).Debugf("Failed to write to stream")
|
||||
log.WithError(err).Debugf("Could not write to stream")
|
||||
}
|
||||
return errors.New("requested more than the max block limit")
|
||||
}
|
||||
@@ -79,12 +79,12 @@ func (s *Service) beaconBlocksRootRPCHandler(ctx context.Context, msg interface{
|
||||
for _, root := range blockRoots {
|
||||
blk, err := s.db.Block(ctx, root)
|
||||
if err != nil {
|
||||
log.WithError(err).Debug("Failed to fetch block")
|
||||
log.WithError(err).Debug("Could not fetch block")
|
||||
resp, err := s.generateErrorResponse(responseCodeServerError, types.ErrGeneric.Error())
|
||||
if err != nil {
|
||||
log.WithError(err).Debug("Failed to generate a response error")
|
||||
log.WithError(err).Debug("Could not generate a response error")
|
||||
} else if _, err := stream.Write(resp); err != nil {
|
||||
log.WithError(err).Debugf("Failed to write to stream")
|
||||
log.WithError(err).Debugf("Could not write to stream")
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ func TestRecentBeaconBlocks_RPCRequestSent(t *testing.T) {
|
||||
response := []*ethpb.SignedBeaconBlock{blockB, blockA}
|
||||
for _, blk := range response {
|
||||
_, err := stream.Write([]byte{responseCodeSuccess})
|
||||
assert.NoError(t, err, "Failed to write to stream")
|
||||
assert.NoError(t, err, "Could not write to stream")
|
||||
_, err = p2.Encoding().EncodeWithMaxLength(stream, blk)
|
||||
assert.NoError(t, err, "Could not send response back")
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ var backOffTime = map[types.SSZUint64]time.Duration{
|
||||
func (s *Service) goodbyeRPCHandler(_ context.Context, msg interface{}, stream libp2pcore.Stream) error {
|
||||
defer func() {
|
||||
if err := stream.Close(); err != nil {
|
||||
log.WithError(err).Error("Failed to close stream")
|
||||
log.WithError(err).Debug("Could not close stream")
|
||||
}
|
||||
}()
|
||||
SetRPCStreamDeadlines(stream)
|
||||
@@ -93,7 +93,7 @@ func (s *Service) sendGoodByeMessage(ctx context.Context, code types.RPCGoodbyeC
|
||||
}
|
||||
defer func() {
|
||||
if err := helpers.FullClose(stream); err != nil && err.Error() != mux.ErrReset.Error() {
|
||||
log.WithError(err).Debugf("Failed to reset stream with protocol %s", stream.Protocol())
|
||||
log.WithError(err).Debugf("Could not reset stream with protocol %s", stream.Protocol())
|
||||
}
|
||||
}()
|
||||
log := log.WithField("Reason", goodbyeMessage(code))
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
func (s *Service) metaDataHandler(_ context.Context, _ interface{}, stream libp2pcore.Stream) error {
|
||||
defer func() {
|
||||
if err := stream.Close(); err != nil {
|
||||
log.WithError(err).Debug("Failed to close stream")
|
||||
log.WithError(err).Debug("Could not close stream")
|
||||
}
|
||||
}()
|
||||
SetRPCStreamDeadlines(stream)
|
||||
@@ -45,7 +45,7 @@ func (s *Service) sendMetaDataRequest(ctx context.Context, id peer.ID) (*pb.Meta
|
||||
// stream early leads it to a reset.
|
||||
defer func() {
|
||||
if err := helpers.FullClose(stream); isValidStreamError(err) {
|
||||
log.WithError(err).Debugf("Failed to reset stream for protocol %s", stream.Protocol())
|
||||
log.WithError(err).Debugf("Could not reset stream for protocol %s", stream.Protocol())
|
||||
}
|
||||
}()
|
||||
code, errMsg, err := ReadStatusCode(stream, s.p2p.Encoding())
|
||||
|
||||
@@ -22,7 +22,7 @@ func (s *Service) pingHandler(_ context.Context, msg interface{}, stream libp2pc
|
||||
m, ok := msg.(*types.SSZUint64)
|
||||
if !ok {
|
||||
if err := stream.Close(); err != nil {
|
||||
log.WithError(err).Debug("Failed to close stream")
|
||||
log.WithError(err).Debug("Could not close stream")
|
||||
}
|
||||
return fmt.Errorf("wrong message type for ping, got %T, wanted *uint64", msg)
|
||||
}
|
||||
@@ -38,20 +38,20 @@ func (s *Service) pingHandler(_ context.Context, msg interface{}, stream libp2pc
|
||||
s.writeErrorResponseToStream(responseCodeInvalidRequest, types.ErrInvalidSequenceNum.Error(), stream)
|
||||
}
|
||||
if err := stream.Close(); err != nil {
|
||||
log.WithError(err).Debug("Failed to close stream")
|
||||
log.WithError(err).Debug("Could not close stream")
|
||||
}
|
||||
return err
|
||||
}
|
||||
if _, err := stream.Write([]byte{responseCodeSuccess}); err != nil {
|
||||
if err := stream.Close(); err != nil {
|
||||
log.WithError(err).Debug("Failed to close stream")
|
||||
log.WithError(err).Debug("Could not close stream")
|
||||
}
|
||||
return err
|
||||
}
|
||||
sq := types.SSZUint64(s.p2p.MetadataSeq())
|
||||
if _, err := s.p2p.Encoding().EncodeWithMaxLength(stream, &sq); err != nil {
|
||||
if err := stream.Close(); err != nil {
|
||||
log.WithError(err).Debug("Failed to close stream")
|
||||
log.WithError(err).Debug("Could not close stream")
|
||||
}
|
||||
return err
|
||||
}
|
||||
@@ -59,7 +59,7 @@ func (s *Service) pingHandler(_ context.Context, msg interface{}, stream libp2pc
|
||||
if valid {
|
||||
// If the sequence number was valid we're done.
|
||||
if err := stream.Close(); err != nil {
|
||||
log.WithError(err).Debug("Failed to close stream")
|
||||
log.WithError(err).Debug("Could not close stream")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -68,7 +68,7 @@ func (s *Service) pingHandler(_ context.Context, msg interface{}, stream libp2pc
|
||||
go func() {
|
||||
defer func() {
|
||||
if err := stream.Close(); err != nil {
|
||||
log.WithError(err).Debug("Failed to close stream")
|
||||
log.WithError(err).Debug("Could not close stream")
|
||||
}
|
||||
}()
|
||||
// New context so the calling function doesn't cancel on us.
|
||||
@@ -80,7 +80,7 @@ func (s *Service) pingHandler(_ context.Context, msg interface{}, stream libp2pc
|
||||
// type isn't compatible with the error we have, so a direct
|
||||
// equality checks fails.
|
||||
if !strings.Contains(err.Error(), types.ErrIODeadline.Error()) {
|
||||
log.WithField("peer", stream.Conn().RemotePeer()).WithError(err).Debug("Failed to send metadata request")
|
||||
log.WithField("peer", stream.Conn().RemotePeer()).WithError(err).Debug("Could not send metadata request")
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -103,7 +103,7 @@ func (s *Service) sendPingRequest(ctx context.Context, id peer.ID) error {
|
||||
currentTime := timeutils.Now()
|
||||
defer func() {
|
||||
if err := helpers.FullClose(stream); err != nil && err.Error() != mux.ErrReset.Error() {
|
||||
log.WithError(err).Debugf("Failed to reset stream with protocol %s", stream.Protocol())
|
||||
log.WithError(err).Debugf("Could not reset stream with protocol %s", stream.Protocol())
|
||||
}
|
||||
}()
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ func SendBeaconBlocksByRangeRequest(
|
||||
}
|
||||
defer func() {
|
||||
if err := streamhelpers.FullClose(stream); err != nil && err.Error() != mux.ErrReset.Error() {
|
||||
log.WithError(err).Debugf("Failed to close stream with protocol %s", stream.Protocol())
|
||||
log.WithError(err).Debugf("Could not close stream with protocol %s", stream.Protocol())
|
||||
}
|
||||
}()
|
||||
|
||||
@@ -89,7 +89,7 @@ func SendBeaconBlocksByRootRequest(
|
||||
}
|
||||
defer func() {
|
||||
if err := streamhelpers.FullClose(stream); err != nil && err.Error() != mux.ErrReset.Error() {
|
||||
log.WithError(err).Debugf("Failed to reset stream with protocol %s", stream.Protocol())
|
||||
log.WithError(err).Debugf("Could not reset stream with protocol %s", stream.Protocol())
|
||||
}
|
||||
}()
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ func TestSendRequest_SendBeaconBlocksByRootRequest(t *testing.T) {
|
||||
}
|
||||
}
|
||||
_, err := stream.Write([]byte{0x00})
|
||||
assert.NoError(t, err, "Failed to write to stream")
|
||||
assert.NoError(t, err, "Could not write to stream")
|
||||
_, err = p2pProvider.Encoding().EncodeWithMaxLength(stream, blk)
|
||||
assert.NoError(t, err, "Could not send response back")
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ func (s *Service) maintainPeerStatuses() {
|
||||
}
|
||||
if timeutils.Now().After(lastUpdated.Add(interval)) {
|
||||
if err := s.reValidatePeer(s.ctx, id); err != nil {
|
||||
log.WithField("peer", id).WithError(err).Debug("Failed to revalidate peer")
|
||||
log.WithField("peer", id).WithError(err).Debug("Could not revalidate peer")
|
||||
s.p2p.Peers().Scorers().BadResponsesScorer().Increment(id)
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ func (s *Service) sendRPCStatusRequest(ctx context.Context, id peer.ID) error {
|
||||
}
|
||||
defer func() {
|
||||
if err := streamhelpers.FullClose(stream); err != nil && err.Error() != mux.ErrReset.Error() {
|
||||
log.WithError(err).Debugf("Failed to reset stream with protocol %s", stream.Protocol())
|
||||
log.WithError(err).Debugf("Could not reset stream with protocol %s", stream.Protocol())
|
||||
}
|
||||
}()
|
||||
|
||||
@@ -177,7 +177,7 @@ func (s *Service) reValidatePeer(ctx context.Context, id peer.ID) error {
|
||||
func (s *Service) statusRPCHandler(ctx context.Context, msg interface{}, stream libp2pcore.Stream) error {
|
||||
defer func() {
|
||||
if err := stream.Close(); err != nil {
|
||||
log.WithError(err).Debug("Failed to close stream")
|
||||
log.WithError(err).Debug("Could not close stream")
|
||||
}
|
||||
}()
|
||||
ctx, cancel := context.WithTimeout(ctx, ttfbTimeout)
|
||||
@@ -211,7 +211,7 @@ func (s *Service) statusRPCHandler(ctx context.Context, msg interface{}, stream
|
||||
return err
|
||||
}
|
||||
if err := stream.Close(); err != nil { // Close before disconnecting.
|
||||
log.WithError(err).Debug("Failed to close stream")
|
||||
log.WithError(err).Debug("Could not close stream")
|
||||
}
|
||||
if err := s.sendGoodByeAndDisconnect(ctx, p2ptypes.GoodbyeCodeWrongNetwork, remotePeer); err != nil {
|
||||
return err
|
||||
@@ -225,13 +225,13 @@ func (s *Service) statusRPCHandler(ctx context.Context, msg interface{}, stream
|
||||
originalErr := err
|
||||
resp, err := s.generateErrorResponse(respCode, err.Error())
|
||||
if err != nil {
|
||||
log.WithError(err).Debug("Failed to generate a response error")
|
||||
log.WithError(err).Debug("Could not generate a response error")
|
||||
} else if _, err := stream.Write(resp); err != nil {
|
||||
// The peer may already be ignoring us, as we disagree on fork version, so log this as debug only.
|
||||
log.WithError(err).Debug("Failed to write to stream")
|
||||
log.WithError(err).Debug("Could not write to stream")
|
||||
}
|
||||
if err := stream.Close(); err != nil { // Close before disconnecting.
|
||||
log.WithError(err).Debug("Failed to close stream")
|
||||
log.WithError(err).Debug("Could not close stream")
|
||||
}
|
||||
if err := s.sendGoodByeAndDisconnect(ctx, p2ptypes.GoodbyeCodeGenericError, remotePeer); err != nil {
|
||||
return err
|
||||
@@ -262,7 +262,7 @@ func (s *Service) respondWithStatus(ctx context.Context, stream network.Stream)
|
||||
}
|
||||
|
||||
if _, err := stream.Write([]byte{responseCodeSuccess}); err != nil {
|
||||
log.WithError(err).Debug("Failed to write to stream")
|
||||
log.WithError(err).Debug("Could not write to stream")
|
||||
}
|
||||
_, err = s.p2p.Encoding().EncodeWithMaxLength(stream, resp)
|
||||
return err
|
||||
|
||||
@@ -758,7 +758,7 @@ func TestStatusRPCRequest_BadPeerHandshake(t *testing.T) {
|
||||
FinalizedRoot: finalizedRoot[:],
|
||||
}
|
||||
if _, err := stream.Write([]byte{responseCodeSuccess}); err != nil {
|
||||
log.WithError(err).Error("Failed to write to stream")
|
||||
log.WithError(err).Debug("Could not write to stream")
|
||||
}
|
||||
_, err := r.p2p.Encoding().EncodeWithMaxLength(stream, expected)
|
||||
assert.NoError(t, err)
|
||||
@@ -773,7 +773,7 @@ func TestStatusRPCRequest_BadPeerHandshake(t *testing.T) {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
|
||||
connectionState, err := p1.Peers().ConnectionState(p2.PeerID())
|
||||
require.NoError(t, err, "Failed to obtain peer connection state")
|
||||
require.NoError(t, err, "Could not obtain peer connection state")
|
||||
assert.Equal(t, peers.PeerDisconnected, connectionState, "Expected peer to be disconnected")
|
||||
|
||||
assert.Equal(t, true, p1.Peers().Scorers().IsBadPeer(p2.PeerID()), "Peer is not marked as bad")
|
||||
|
||||
@@ -284,7 +284,7 @@ func (s *Service) registerHandlers() {
|
||||
log.Debug("Context closed, exiting goroutine")
|
||||
return
|
||||
case err := <-stateSub.Err():
|
||||
log.WithError(err).Error("Subscription to state notifier failed")
|
||||
log.WithError(err).Error("Could not subscribe to state notifier")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ type subHandler func(context.Context, proto.Message) error
|
||||
func (s *Service) noopValidator(_ context.Context, _ peer.ID, msg *pubsub.Message) pubsub.ValidationResult {
|
||||
m, err := s.decodePubsubMessage(msg)
|
||||
if err != nil {
|
||||
log.WithError(err).Debug("Failed to decode message")
|
||||
log.WithError(err).Debug("Could not decode message")
|
||||
return pubsub.ValidationReject
|
||||
}
|
||||
msg.ValidatorData = m
|
||||
@@ -96,7 +96,8 @@ func (s *Service) subscribeWithBase(topic string, validator pubsub.ValidatorEx,
|
||||
log := log.WithField("topic", topic)
|
||||
|
||||
if err := s.p2p.PubSub().RegisterTopicValidator(s.wrapAndReportValidation(topic, validator)); err != nil {
|
||||
log.WithError(err).Error("Failed to register validator")
|
||||
log.WithError(err).Error("Could not register validator for topic")
|
||||
return nil
|
||||
}
|
||||
|
||||
sub, err := s.p2p.SubscribeToTopic(topic)
|
||||
@@ -104,7 +105,7 @@ func (s *Service) subscribeWithBase(topic string, validator pubsub.ValidatorEx,
|
||||
// Any error subscribing to a PubSub topic would be the result of a misconfiguration of
|
||||
// libp2p PubSub library or a subscription request to a topic that fails to match the topic
|
||||
// subscription filter.
|
||||
log.WithError(err).WithField("topic", topic).Error("Failed to subscribe to topic")
|
||||
log.WithError(err).WithField("topic", topic).Error("Could not subscribe topic")
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -134,7 +135,7 @@ func (s *Service) subscribeWithBase(topic string, validator pubsub.ValidatorEx,
|
||||
|
||||
if err := handle(ctx, msg.ValidatorData.(proto.Message)); err != nil {
|
||||
traceutil.AnnotateError(span, err)
|
||||
log.WithError(err).Debug("Failed to handle p2p pubsub")
|
||||
log.WithError(err).Debug("Could not handle p2p pubsub")
|
||||
messageFailedProcessingCounter.WithLabelValues(topic).Inc()
|
||||
return
|
||||
}
|
||||
@@ -306,7 +307,7 @@ func (s *Service) reValidateSubscriptions(subscriptions map[uint64]*pubsub.Subsc
|
||||
v.Cancel()
|
||||
fullTopic := fmt.Sprintf(topicFormat, digest, k) + s.p2p.Encoding().ProtocolSuffix()
|
||||
if err := s.p2p.PubSub().UnregisterTopicValidator(fullTopic); err != nil {
|
||||
log.WithError(err).Error("Failed to unregister topic validator")
|
||||
log.WithError(err).Error("Could not unregister topic validator")
|
||||
}
|
||||
delete(subscriptions, k)
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ func (s *Service) committeeIndexBeaconAttestationSubscriber(_ context.Context, m
|
||||
|
||||
exists, err := s.attPool.HasAggregatedAttestation(a)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to determine if attestation pool has this atttestation")
|
||||
return errors.Wrap(err, "Could not determine if attestation pool has this atttestation")
|
||||
}
|
||||
if exists {
|
||||
return nil
|
||||
|
||||
@@ -37,7 +37,7 @@ func (s *Service) beaconBlockSubscriber(ctx context.Context, msg proto.Message)
|
||||
|
||||
// Delete attestations from the block in the pool to avoid inclusion in future block.
|
||||
if err := s.deleteAttsInPool(block.Body.Attestations); err != nil {
|
||||
log.Errorf("Could not delete attestations in pool: %v", err)
|
||||
log.Debugf("Could not delete attestations in pool: %v", err)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ func TestRevalidateSubscription_CorrectlyFormatsTopic(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
r.reValidateSubscriptions(subscriptions, []uint64{2}, defaultTopic, digest)
|
||||
require.LogsDoNotContain(t, hook, "Failed to unregister topic validator")
|
||||
require.LogsDoNotContain(t, hook, "Could not unregister topic validator")
|
||||
}
|
||||
|
||||
func TestStaticSubnets(t *testing.T) {
|
||||
|
||||
@@ -37,7 +37,7 @@ func (s *Service) validateAggregateAndProof(ctx context.Context, pid peer.ID, ms
|
||||
|
||||
raw, err := s.decodePubsubMessage(msg)
|
||||
if err != nil {
|
||||
log.WithError(err).Debug("Failed to decode message")
|
||||
log.WithError(err).Debug("Could not decode message")
|
||||
traceutil.AnnotateError(span, err)
|
||||
return pubsub.ValidationReject
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ func (s *Service) validateAttesterSlashing(ctx context.Context, pid peer.ID, msg
|
||||
|
||||
m, err := s.decodePubsubMessage(msg)
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Failed to decode message")
|
||||
log.WithError(err).Debug("Could not decode message")
|
||||
traceutil.AnnotateError(span, err)
|
||||
return pubsub.ValidationReject
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p
|
||||
|
||||
m, err := s.decodePubsubMessage(msg)
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Failed to decode message")
|
||||
log.WithError(err).Debug("Could not decode message")
|
||||
traceutil.AnnotateError(span, err)
|
||||
return pubsub.ValidationReject
|
||||
}
|
||||
@@ -107,7 +107,7 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p
|
||||
|
||||
preState, err := s.chain.AttestationPreState(ctx, att)
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Failed to retrieve pre state")
|
||||
log.WithError(err).Error("Could not to retrieve pre state")
|
||||
traceutil.AnnotateError(span, err)
|
||||
return pubsub.ValidationIgnore
|
||||
}
|
||||
@@ -148,7 +148,7 @@ func (s *Service) validateUnaggregatedAttTopic(ctx context.Context, a *eth.Attes
|
||||
format := p2p.GossipTypeMapping[reflect.TypeOf(ð.Attestation{})]
|
||||
digest, err := s.forkDigest()
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Failed to compute fork digest")
|
||||
log.WithError(err).Error("Could not compute fork digest")
|
||||
traceutil.AnnotateError(span, err)
|
||||
return pubsub.ValidationIgnore
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package sync
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
@@ -40,7 +41,7 @@ func (s *Service) validateBeaconBlockPubSub(ctx context.Context, pid peer.ID, ms
|
||||
|
||||
m, err := s.decodePubsubMessage(msg)
|
||||
if err != nil {
|
||||
log.WithError(err).Debug("Failed to decode message")
|
||||
log.WithError(err).Debug("Could not decode message")
|
||||
traceutil.AnnotateError(span, err)
|
||||
return pubsub.ValidationReject
|
||||
}
|
||||
@@ -50,10 +51,12 @@ func (s *Service) validateBeaconBlockPubSub(ctx context.Context, pid peer.ID, ms
|
||||
|
||||
blk, ok := m.(*ethpb.SignedBeaconBlock)
|
||||
if !ok {
|
||||
log.WithError(errors.New("msg is not ethpb.SignedBeaconBlock")).Debug("Rejected block")
|
||||
return pubsub.ValidationReject
|
||||
}
|
||||
|
||||
if blk.Block == nil {
|
||||
log.WithError(errors.New("block.Block is nil")).Debug("Rejected block")
|
||||
return pubsub.ValidationReject
|
||||
}
|
||||
|
||||
@@ -73,6 +76,7 @@ func (s *Service) validateBeaconBlockPubSub(ctx context.Context, pid peer.ID, ms
|
||||
|
||||
blockRoot, err := blk.Block.HashTreeRoot()
|
||||
if err != nil {
|
||||
log.WithError(err).WithField("blockSlot", blk.Block.Slot).Debug("Ignored block")
|
||||
return pubsub.ValidationIgnore
|
||||
}
|
||||
if s.db.HasBlock(ctx, blockRoot) {
|
||||
@@ -80,8 +84,9 @@ func (s *Service) validateBeaconBlockPubSub(ctx context.Context, pid peer.ID, ms
|
||||
}
|
||||
// Check if parent is a bad block and then reject the block.
|
||||
if s.hasBadBlock(bytesutil.ToBytes32(blk.Block.ParentRoot)) {
|
||||
log.Debugf("Received block with root %#x that has an invalid parent %#x", blockRoot, blk.Block.ParentRoot)
|
||||
s.setBadBlock(ctx, blockRoot)
|
||||
e := fmt.Errorf("received block with root %#x that has an invalid parent %#x", blockRoot, blk.Block.ParentRoot)
|
||||
log.WithError(e).WithField("blockSlot", blk.Block.Slot).Debug("Rejected block")
|
||||
return pubsub.ValidationReject
|
||||
}
|
||||
|
||||
@@ -93,21 +98,24 @@ func (s *Service) validateBeaconBlockPubSub(ctx context.Context, pid peer.ID, ms
|
||||
s.pendingQueueLock.RUnlock()
|
||||
|
||||
if err := helpers.VerifySlotTime(uint64(s.chain.GenesisTime().Unix()), blk.Block.Slot, params.BeaconNetworkConfig().MaximumGossipClockDisparity); err != nil {
|
||||
log.WithError(err).WithField("blockSlot", blk.Block.Slot).Warn("Rejecting incoming block.")
|
||||
log.WithError(err).WithField("blockSlot", blk.Block.Slot).Debug("Ignored block")
|
||||
return pubsub.ValidationIgnore
|
||||
}
|
||||
|
||||
// Add metrics for block arrival time subtracts slot start time.
|
||||
if captureArrivalTimeMetric(uint64(s.chain.GenesisTime().Unix()), blk.Block.Slot) != nil {
|
||||
if err := captureArrivalTimeMetric(uint64(s.chain.GenesisTime().Unix()), blk.Block.Slot); err != nil {
|
||||
log.WithError(err).WithField("blockSlot", blk.Block.Slot).Debug("Ignored block")
|
||||
return pubsub.ValidationIgnore
|
||||
}
|
||||
|
||||
startSlot, err := helpers.StartSlot(s.chain.FinalizedCheckpt().Epoch)
|
||||
if err != nil {
|
||||
log.WithError(err).WithField("blockSlot", blk.Block.Slot).Debug("Ignored block")
|
||||
return pubsub.ValidationIgnore
|
||||
}
|
||||
if startSlot >= blk.Block.Slot {
|
||||
log.Debug("Block slot older/equal than last finalized epoch start slot, rejecting it")
|
||||
e := fmt.Errorf("finalized slot %d greater or equal to block slot %d", startSlot, blk.Block.Slot)
|
||||
log.WithError(e).WithField("blockSlot", blk.Block.Slot).Debug("Ignored block")
|
||||
return pubsub.ValidationIgnore
|
||||
}
|
||||
|
||||
@@ -115,14 +123,16 @@ func (s *Service) validateBeaconBlockPubSub(ctx context.Context, pid peer.ID, ms
|
||||
if !s.db.HasBlock(ctx, bytesutil.ToBytes32(blk.Block.ParentRoot)) {
|
||||
s.pendingQueueLock.Lock()
|
||||
if err := s.insertBlockToPendingQueue(blk.Block.Slot, blk, blockRoot); err != nil {
|
||||
log.WithError(err).WithField("blockSlot", blk.Block.Slot).Debug("Ignored block")
|
||||
return pubsub.ValidationIgnore
|
||||
}
|
||||
s.pendingQueueLock.Unlock()
|
||||
log.WithError(errors.New("unknown parent")).WithField("blockSlot", blk.Block.Slot).Debug("Ignored block")
|
||||
return pubsub.ValidationIgnore
|
||||
}
|
||||
|
||||
if err := s.validateBeaconBlock(ctx, blk, blockRoot); err != nil {
|
||||
log.WithError(err).WithField("blockSlot", blk.Block.Slot).Warn("Could not validate beacon block")
|
||||
log.WithError(err).WithField("blockSlot", blk.Block.Slot).Warn("Rejected block")
|
||||
return pubsub.ValidationReject
|
||||
}
|
||||
|
||||
@@ -142,7 +152,10 @@ func (s *Service) validateBeaconBlock(ctx context.Context, blk *ethpb.SignedBeac
|
||||
hasStateSummaryDB := s.db.HasStateSummary(ctx, bytesutil.ToBytes32(blk.Block.ParentRoot))
|
||||
hasStateSummaryCache := s.stateSummaryCache.Has(bytesutil.ToBytes32(blk.Block.ParentRoot))
|
||||
if !hasStateSummaryDB && !hasStateSummaryCache {
|
||||
return errors.New("no access to parent state")
|
||||
_, err := s.stateGen.RecoverStateSummary(ctx, bytesutil.ToBytes32(blk.Block.ParentRoot))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
parentState, err := s.stateGen.StateByRoot(ctx, bytesutil.ToBytes32(blk.Block.ParentRoot))
|
||||
if err != nil {
|
||||
|
||||
@@ -121,6 +121,67 @@ func TestValidateBeaconBlockPubSub_BlockAlreadyPresentInDB(t *testing.T) {
|
||||
assert.Equal(t, false, result)
|
||||
}
|
||||
|
||||
func TestValidateBeaconBlockPubSub_CanRecoverStateSummary(t *testing.T) {
|
||||
db, stateSummaryCache := dbtest.SetupDB(t)
|
||||
p := p2ptest.NewTestP2P(t)
|
||||
ctx := context.Background()
|
||||
beaconState, privKeys := testutil.DeterministicGenesisState(t, 100)
|
||||
parentBlock := testutil.NewBeaconBlock()
|
||||
require.NoError(t, db.SaveBlock(ctx, parentBlock))
|
||||
bRoot, err := parentBlock.Block.HashTreeRoot()
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, db.SaveState(ctx, beaconState, bRoot))
|
||||
copied := beaconState.Copy()
|
||||
require.NoError(t, copied.SetSlot(1))
|
||||
proposerIdx, err := helpers.BeaconProposerIndex(copied)
|
||||
require.NoError(t, err)
|
||||
msg := testutil.NewBeaconBlock()
|
||||
msg.Block.ParentRoot = bRoot[:]
|
||||
msg.Block.Slot = 1
|
||||
msg.Block.ProposerIndex = proposerIdx
|
||||
msg.Signature, err = helpers.ComputeDomainAndSign(beaconState, 0, msg.Block, params.BeaconConfig().DomainBeaconProposer, privKeys[proposerIdx])
|
||||
require.NoError(t, err)
|
||||
|
||||
c, err := lru.New(10)
|
||||
require.NoError(t, err)
|
||||
c2, err := lru.New(10)
|
||||
require.NoError(t, err)
|
||||
stateGen := stategen.New(db, stateSummaryCache)
|
||||
chainService := &mock.ChainService{Genesis: time.Unix(time.Now().Unix()-int64(params.BeaconConfig().SecondsPerSlot), 0),
|
||||
State: beaconState,
|
||||
FinalizedCheckPoint: ðpb.Checkpoint{
|
||||
Epoch: 0,
|
||||
Root: make([]byte, 32),
|
||||
},
|
||||
}
|
||||
r := &Service{
|
||||
db: db,
|
||||
p2p: p,
|
||||
initialSync: &mockSync.Sync{IsSyncing: false},
|
||||
chain: chainService,
|
||||
blockNotifier: chainService.BlockNotifier(),
|
||||
seenBlockCache: c,
|
||||
badBlockCache: c2,
|
||||
slotToPendingBlocks: gcache.New(time.Second, 2*time.Second),
|
||||
seenPendingBlocks: make(map[[32]byte]bool),
|
||||
stateSummaryCache: stateSummaryCache,
|
||||
stateGen: stateGen,
|
||||
}
|
||||
buf := new(bytes.Buffer)
|
||||
_, err = p.Encoding().EncodeGossip(buf, msg)
|
||||
require.NoError(t, err)
|
||||
topic := p2p.GossipTypeMapping[reflect.TypeOf(msg)]
|
||||
m := &pubsub.Message{
|
||||
Message: &pubsubpb.Message{
|
||||
Data: buf.Bytes(),
|
||||
Topic: &topic,
|
||||
},
|
||||
}
|
||||
result := r.validateBeaconBlockPubSub(ctx, "", m) == pubsub.ValidationAccept
|
||||
assert.Equal(t, true, result)
|
||||
assert.NotNil(t, m.ValidatorData, "Decoded message was not set on the message validator data")
|
||||
}
|
||||
|
||||
func TestValidateBeaconBlockPubSub_ValidProposerSignature(t *testing.T) {
|
||||
db, stateSummaryCache := dbtest.SetupDB(t)
|
||||
p := p2ptest.NewTestP2P(t)
|
||||
@@ -480,7 +541,6 @@ func TestValidateBeaconBlockPubSub_FilterByFinalizedEpoch(t *testing.T) {
|
||||
}
|
||||
|
||||
r.validateBeaconBlockPubSub(context.Background(), "", m)
|
||||
require.LogsContain(t, hook, "Block slot older/equal than last finalized epoch start slot, rejecting it")
|
||||
|
||||
hook.Reset()
|
||||
b.Block.Slot = params.BeaconConfig().SlotsPerEpoch
|
||||
@@ -495,7 +555,6 @@ func TestValidateBeaconBlockPubSub_FilterByFinalizedEpoch(t *testing.T) {
|
||||
}
|
||||
|
||||
r.validateBeaconBlockPubSub(context.Background(), "", m)
|
||||
require.LogsDoNotContain(t, hook, "Block slot older/equal than last finalized epoch start slot, rejecting itt")
|
||||
}
|
||||
|
||||
func TestValidateBeaconBlockPubSub_ParentNotFinalizedDescendant(t *testing.T) {
|
||||
|
||||
@@ -30,7 +30,7 @@ func (s *Service) validateProposerSlashing(ctx context.Context, pid peer.ID, msg
|
||||
|
||||
m, err := s.decodePubsubMessage(msg)
|
||||
if err != nil {
|
||||
log.WithError(err).Debug("Failed to decode message")
|
||||
log.WithError(err).Debug("Could not decode message")
|
||||
traceutil.AnnotateError(span, err)
|
||||
return pubsub.ValidationReject
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ func (s *Service) validateVoluntaryExit(ctx context.Context, pid peer.ID, msg *p
|
||||
|
||||
m, err := s.decodePubsubMessage(msg)
|
||||
if err != nil {
|
||||
log.WithError(err).Debug("Failed to decode message")
|
||||
log.WithError(err).Debug("Could not decode message")
|
||||
traceutil.AnnotateError(span, err)
|
||||
return pubsub.ValidationReject
|
||||
}
|
||||
|
||||
@@ -112,6 +112,7 @@ var appHelpFlagGroups = []flagGroup{
|
||||
flags.WeakSubjectivityCheckpt,
|
||||
flags.EnableBackupWebhookFlag,
|
||||
flags.BackupWebhookOutputDir,
|
||||
flags.Eth1HeaderReqLimit,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Prysmatic Labs Contract Page
|
||||
# Contracts
|
||||
|
||||
This page serves as a main reference for Prysmatic Labs' smart contracts implementation for Ethereum Serenity.
|
||||
This page serves as a main reference for the smart contract tooling used internally in Prysm.
|
||||
|
||||
## Table of Contents
|
||||
**THIS DOES NOT CONTAIN CONTRACTS TO BE USED IN PRODUCTION**.
|
||||
|
||||
- [Validator Registration Contract](https://github.com/prysmaticlabs/prysm/blob/master/contracts/validator-registration-contract/README.md)
|
||||
|
||||
@@ -1,56 +1,6 @@
|
||||
## Deposit Contract
|
||||
## Prysm Internal Validator Deposit Contract
|
||||
|
||||
A validator will deposit 32 ETH to the deposit
|
||||
contract. The contract will generate a log showing the validator as a
|
||||
qualified validator.
|
||||
The deposit is considered to be burned. As you burn the 32 ETH to participate,
|
||||
the beacon chain will see it and will credit the validator with the validator bond,
|
||||
At some point in the future, after a hard fork,
|
||||
the original deposit + interest can be withdrawn back on one of the shards.
|
||||
To call the `registration` function, it takes arguments of `pubkey`,
|
||||
`proof_of_possession`, `withdrawal_credentials`.
|
||||
If the user wants to deposit more than `DEPOSIT_SIZE` ETH, they would
|
||||
need to make multiple `deposit` calls.
|
||||
When the contract publishes the `ChainStart` log, beacon nodes will
|
||||
start off the beacon chain with slot 0 and last recorded `block.timestamp`
|
||||
as beacon chain genesis time.
|
||||
The registration contract generate logs with the various arguments
|
||||
for consumption by beacon nodes. It does not validate `proof_of_possession`
|
||||
and `withdrawal_credentials`, pushing the validation logic to the
|
||||
beacon chain.
|
||||
|
||||
## How to generate bindings for vyper contract
|
||||
|
||||
This requires that you have vyper and abigen installed in your local machine.
|
||||
Vyper: https://github.com/ethereum/vyper
|
||||
Abigen: https://github.com/ethereum/go-ethereum/tree/master/cmd/abigen
|
||||
|
||||
To generate the abi using the vyper compiler, you can use
|
||||
|
||||
```
|
||||
|
||||
docker run -v $(pwd):/code ethereum/vyper:0.1.0b12 -f abi /code/depositContract.v.py > abi.json
|
||||
|
||||
```
|
||||
|
||||
Then the abi will be outputted and you can save it in `abi.json` in the folder.
|
||||
|
||||
To generate the bytecode you can then use
|
||||
|
||||
```
|
||||
|
||||
docker run -v $(pwd):/code ethereum/vyper:0.1.0b12 /code/depositContract.v.py > bytecode.bin
|
||||
|
||||
```
|
||||
|
||||
and save the bytecode in `bytecode.bin` in the folder. Now with both the abi and bytecode
|
||||
we can generate the go bindings.
|
||||
|
||||
```
|
||||
|
||||
bazel run @com_github_ethereum_go_ethereum//cmd/abigen -- -bin $(pwd)/bytecode.bin -abi $(pwd)/abi.json -out $(pwd)/depositContract.go --pkg depositcontract --type DepositContract
|
||||
|
||||
```
|
||||
**NOTE: THIS IS NOT THE OFFICIAL ETH2 VALIDATOR DEPOSIT CONTRACT. THE OFFICIAL CONTRACT CAN ONLY BE FOUND [HERE](https://github.com/ethereum/eth2.0-specs/blob/e4a9c5fa29def20c4264cd860868f131d6f40e72/solidity_deposit_contract/deposit_contract.sol). THE ONLY DEPOSIT CONTRACT ON MAINNET HAS ADDRESS 0x00000000219ab540356cbb839cbe05303d7705fa. DO NOT USE THE CONTRACT IN THIS FOLDER OUTSIDE OF DEVELOPMENT**
|
||||
|
||||
## How to execute tests
|
||||
|
||||
|
||||
2
deps.bzl
2
deps.bzl
@@ -601,7 +601,7 @@ def prysm_deps():
|
||||
# Note: The keep directives help gazelle leave this alone.
|
||||
go_repository(
|
||||
name = "com_github_ethereum_go_ethereum",
|
||||
commit = "233538bfc3d8e62a179ffe2af8015d03842a9dc3", # keep
|
||||
commit = "1fb46e30795130091776dcb1359e75bd3ba7a356", # keep
|
||||
importpath = "github.com/ethereum/go-ethereum", # keep
|
||||
# Note: go-ethereum is not bazel-friendly with regards to cgo. We have a
|
||||
# a fork that has resolved these issues by disabling HID/USB support and
|
||||
|
||||
@@ -4,6 +4,7 @@ This is the main project folder of the end-to-end testing suite for Prysm. This
|
||||
It also performs a test on a syncing node, and supports featureflags to allow easy E2E testing of experimental features.
|
||||
|
||||
## How it works
|
||||
|
||||
Through the `end2EndConfig` struct, you can declare several options such as how many epochs the test should run for, and what `BeaconConfig` the test should use. You can also declare how many beacon nodes and validator clients are run, the E2E will automatically divide the validators evently among the beacon nodes.
|
||||
|
||||
In order to "evaluate" the state of the beacon chain while the E2E is running, there are `Evaluators` that use the beacon chain node API to determine if the network is performing as it should. This can evaluate for conditions like validator activation, finalization, validator participation and more.
|
||||
@@ -11,12 +12,14 @@ In order to "evaluate" the state of the beacon chain while the E2E is running, t
|
||||
Evaluators have 3 parts, the name for it's test name, a `policy` which declares which epoch(s) the evaluator should run, and then the `evaluation` which uses the beacon chain API to determine if the beacon chain passes certain conditions like finality.
|
||||
|
||||
## Current end-to-end tests
|
||||
|
||||
* Minimal Config - 2 beacon nodes, 256 validators, running for 8 epochs
|
||||
* Minimal Config Slashing Test - 2 beacon nodes, 256 validators, tests attester and proposer slashing
|
||||
|
||||
## Instructions
|
||||
|
||||
If you wish to run all the minimal spec E2E tests, you can run them through bazel with:
|
||||
|
||||
```
|
||||
bazel test //endtoend:go_default_test --define=ssz=minimal --test_output=streamed --test_arg=-test.v --nocache_test_results
|
||||
bazel test //endtoend:go_default_test --define=ssz=minimal --test_output=streamed
|
||||
```
|
||||
|
||||
6
go.mod
6
go.mod
@@ -47,7 +47,6 @@ require (
|
||||
github.com/ianlancetaylor/cgosymbolizer v0.0.0-20200424224625-be1b05b0b279
|
||||
github.com/influxdata/influxdb v1.8.0 // indirect
|
||||
github.com/ipfs/go-ipfs-addr v0.0.1
|
||||
github.com/ipfs/go-log v1.0.4
|
||||
github.com/ipfs/go-log/v2 v2.1.1
|
||||
github.com/joonix/log v0.0.0-20200409080653-9c1d2ceb5f1d
|
||||
github.com/json-iterator/go v1.1.10
|
||||
@@ -58,9 +57,7 @@ require (
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/libp2p/go-libp2p v0.10.2
|
||||
github.com/libp2p/go-libp2p-blankhost v0.2.0
|
||||
github.com/libp2p/go-libp2p-circuit v0.3.1
|
||||
github.com/libp2p/go-libp2p-core v0.6.1
|
||||
github.com/libp2p/go-libp2p-crypto v0.1.0
|
||||
github.com/libp2p/go-libp2p-noise v0.1.1
|
||||
github.com/libp2p/go-libp2p-pubsub v0.3.6
|
||||
github.com/libp2p/go-libp2p-secio v0.2.2
|
||||
@@ -102,7 +99,6 @@ require (
|
||||
github.com/trailofbits/go-mutexasserts v0.0.0-20200708152505-19999e7d3cef
|
||||
github.com/tyler-smith/go-bip39 v1.0.2
|
||||
github.com/urfave/cli/v2 v2.2.0
|
||||
github.com/wealdtech/go-bytesutil v1.1.1
|
||||
github.com/wealdtech/go-eth2-util v1.6.2
|
||||
github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4 v1.1.1
|
||||
github.com/wercker/journalhook v0.0.0-20180428041537-5d0a5ae867b3
|
||||
@@ -135,6 +131,6 @@ require (
|
||||
k8s.io/utils v0.0.0-20200520001619-278ece378a50 // indirect
|
||||
)
|
||||
|
||||
replace github.com/ethereum/go-ethereum => github.com/prysmaticlabs/bazel-go-ethereum v0.0.0-20201116135122-233538bfc3d8
|
||||
replace github.com/ethereum/go-ethereum => github.com/prysmaticlabs/bazel-go-ethereum v0.0.0-20201126065335-1fb46e307951
|
||||
|
||||
replace github.com/json-iterator/go => github.com/prestonvanloon/go v1.1.7-0.20190722034630-4f2e55fcf87b
|
||||
|
||||
4
go.sum
4
go.sum
@@ -963,8 +963,8 @@ github.com/prometheus/tsdb v0.10.0 h1:If5rVCMTp6W2SiRAQFlbpJNgVlgMEd+U2GZckwK38i
|
||||
github.com/prometheus/tsdb v0.10.0/go.mod h1:oi49uRhEe9dPUTlS3JRZOwJuVi6tmh10QSgwXEyGCt4=
|
||||
github.com/protolambda/zssz v0.1.5 h1:7fjJjissZIIaa2QcvmhS/pZISMX21zVITt49sW1ouek=
|
||||
github.com/protolambda/zssz v0.1.5/go.mod h1:a4iwOX5FE7/JkKA+J/PH0Mjo9oXftN6P8NZyL28gpag=
|
||||
github.com/prysmaticlabs/bazel-go-ethereum v0.0.0-20201116135122-233538bfc3d8 h1:Fc6JMvJBFAAdI07o//gNgT5MiCCScpe1u/KM1A6MDGo=
|
||||
github.com/prysmaticlabs/bazel-go-ethereum v0.0.0-20201116135122-233538bfc3d8/go.mod h1:JIfVb6esrqALTExdz9hRYvrP0xBDf6wCncIu1hNwHpM=
|
||||
github.com/prysmaticlabs/bazel-go-ethereum v0.0.0-20201126065335-1fb46e307951 h1:Jncuyb/nIJgXbEe0iGz3MN5JmijPVGzwk3G5FR01phI=
|
||||
github.com/prysmaticlabs/bazel-go-ethereum v0.0.0-20201126065335-1fb46e307951/go.mod h1:JIfVb6esrqALTExdz9hRYvrP0xBDf6wCncIu1hNwHpM=
|
||||
github.com/prysmaticlabs/ethereumapis v0.0.0-20201117145913-073714f478fb h1:OUfQgEA6zB19I66EQ2nPtjdBbk+Vv7eCBf2+x3BTv5w=
|
||||
github.com/prysmaticlabs/ethereumapis v0.0.0-20201117145913-073714f478fb/go.mod h1:k7b2dxy6RppCG6kmOJkNOXzRpEoTdsPygc2aQhsUsZk=
|
||||
github.com/prysmaticlabs/go-bitfield v0.0.0-20200322041314-62c2aee71669 h1:cX6YRZnZ9sgMqM5U14llxUiXVNJ3u07Res1IIjTOgtI=
|
||||
|
||||
@@ -1,29 +1,3 @@
|
||||
# Ethereum Serenity Protocol Buffers
|
||||
# Prysm Protocol Buffers
|
||||
|
||||
This package defines common protobuf messages and services used by Ethereum Serenity clients. Following the structure of:
|
||||
|
||||
```
|
||||
proto/
|
||||
beacon/
|
||||
db/
|
||||
p2p/
|
||||
v1/
|
||||
rpc/
|
||||
v1/
|
||||
cluster/
|
||||
slashing/
|
||||
testing/
|
||||
```
|
||||
|
||||
We specify messages available for p2p communication common to beacon chain nodes and sharding clients.
|
||||
|
||||
For now, we are checking in all generated code to support native go dependency
|
||||
management. The generated pb.go files can be derived from bazel's bin
|
||||
directory.
|
||||
|
||||
For example, when we build the testing go proto library
|
||||
`bazel build //proto/testing:ethereum_testing_go_proto` there is a pb.go
|
||||
generated at
|
||||
`bazel-bin/proto/testing/linux_amd64_stripped/ethereum_testing_go_proto\~/github.com/prysmaticlabs/prysm/proto/testing/test.pb.go`.
|
||||
This generated file can be copied, or you can use you protoc locally if you
|
||||
prefer.
|
||||
This package defines common protobuf messages and services used by Prysm. For now, we are checking in all generated code to support native go dependency management.
|
||||
|
||||
@@ -45,7 +45,7 @@ go_library(
|
||||
|
||||
proto_library(
|
||||
name = "v1_proto",
|
||||
srcs = ["debug.proto"],
|
||||
srcs = ["debug.proto", "health.proto"],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//proto/beacon/p2p/v1:v1_proto",
|
||||
|
||||
422
proto/beacon/rpc/v1/health.pb.go
generated
Executable file
422
proto/beacon/rpc/v1/health.pb.go
generated
Executable file
@@ -0,0 +1,422 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/beacon/rpc/v1/health.proto
|
||||
|
||||
package ethereum_beacon_rpc_v1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
fmt "fmt"
|
||||
io "io"
|
||||
math "math"
|
||||
math_bits "math/bits"
|
||||
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
types "github.com/gogo/protobuf/types"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type LogsEndpointResponse struct {
|
||||
BeaconLogsEndpoint string `protobuf:"bytes,1,opt,name=beacon_logs_endpoint,json=beaconLogsEndpoint,proto3" json:"beacon_logs_endpoint,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *LogsEndpointResponse) Reset() { *m = LogsEndpointResponse{} }
|
||||
func (m *LogsEndpointResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*LogsEndpointResponse) ProtoMessage() {}
|
||||
func (*LogsEndpointResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_2e4b7e98e3e10444, []int{0}
|
||||
}
|
||||
func (m *LogsEndpointResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *LogsEndpointResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_LogsEndpointResponse.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *LogsEndpointResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_LogsEndpointResponse.Merge(m, src)
|
||||
}
|
||||
func (m *LogsEndpointResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *LogsEndpointResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_LogsEndpointResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_LogsEndpointResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *LogsEndpointResponse) GetBeaconLogsEndpoint() string {
|
||||
if m != nil {
|
||||
return m.BeaconLogsEndpoint
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*LogsEndpointResponse)(nil), "ethereum.beacon.rpc.v1.LogsEndpointResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/beacon/rpc/v1/health.proto", fileDescriptor_2e4b7e98e3e10444) }
|
||||
|
||||
var fileDescriptor_2e4b7e98e3e10444 = []byte{
|
||||
// 258 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xc1, 0x4a, 0xc3, 0x40,
|
||||
0x10, 0x86, 0x59, 0x0f, 0x05, 0x17, 0x41, 0x58, 0x4a, 0x91, 0x2a, 0xa1, 0x04, 0x0f, 0x22, 0xb2,
|
||||
0x63, 0xf4, 0x0d, 0x84, 0x62, 0x0f, 0x9e, 0xfa, 0x02, 0x65, 0x13, 0xc7, 0x6c, 0x20, 0xdd, 0x59,
|
||||
0xb2, 0xd3, 0x80, 0x57, 0xbd, 0x7b, 0xf1, 0xa5, 0x3c, 0x0a, 0xbe, 0x80, 0x04, 0x1f, 0x44, 0x9a,
|
||||
0x6d, 0xa0, 0x87, 0x1e, 0x87, 0x6f, 0x7e, 0xfe, 0x6f, 0x46, 0xce, 0x7c, 0x43, 0x4c, 0x90, 0xa3,
|
||||
0x29, 0xc8, 0x41, 0xe3, 0x0b, 0x68, 0x33, 0xb0, 0x68, 0x6a, 0xb6, 0xba, 0x47, 0x6a, 0x82, 0x6c,
|
||||
0xb1, 0xc1, 0xcd, 0x5a, 0xc7, 0x25, 0xdd, 0xf8, 0x42, 0xb7, 0xd9, 0xf4, 0xa2, 0x24, 0x2a, 0x6b,
|
||||
0x04, 0xe3, 0x2b, 0x30, 0xce, 0x11, 0x1b, 0xae, 0xc8, 0x85, 0x98, 0x9a, 0x9e, 0xef, 0x68, 0x3f,
|
||||
0xe5, 0x9b, 0x17, 0xc0, 0xb5, 0xe7, 0xd7, 0x08, 0xd3, 0x85, 0x1c, 0x3f, 0x51, 0x19, 0xe6, 0xee,
|
||||
0xd9, 0x53, 0xe5, 0x78, 0x89, 0xc1, 0x93, 0x0b, 0xa8, 0x6e, 0xe5, 0x38, 0x76, 0xac, 0x6a, 0x2a,
|
||||
0xc3, 0x0a, 0x77, 0xfc, 0x4c, 0xcc, 0xc4, 0xd5, 0xf1, 0x52, 0x45, 0xb6, 0x9f, 0xbc, 0xfb, 0x10,
|
||||
0x72, 0xb4, 0xe8, 0x6d, 0xd5, 0xbb, 0x90, 0xa7, 0x8f, 0xc8, 0xfb, 0x58, 0x4d, 0x74, 0xd4, 0xd0,
|
||||
0x83, 0x86, 0x9e, 0x6f, 0x35, 0xa6, 0x37, 0xfa, 0xf0, 0x51, 0xfa, 0x90, 0x56, 0x7a, 0xfd, 0xf6,
|
||||
0xf3, 0xf7, 0x79, 0x74, 0xa9, 0x52, 0x40, 0xb6, 0xd0, 0x66, 0xa6, 0xf6, 0xd6, 0x0c, 0x5f, 0x82,
|
||||
0xad, 0x2a, 0x0c, 0xaa, 0x0f, 0x27, 0x5f, 0x5d, 0x22, 0xbe, 0xbb, 0x44, 0xfc, 0x76, 0x89, 0xc8,
|
||||
0x47, 0x7d, 0xef, 0xfd, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x73, 0x6a, 0x3d, 0x50, 0x66, 0x01,
|
||||
0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ context.Context
|
||||
var _ grpc.ClientConn
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion4
|
||||
|
||||
// HealthClient is the client API for Health service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type HealthClient interface {
|
||||
GetLogsEndpoint(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*LogsEndpointResponse, error)
|
||||
}
|
||||
|
||||
type healthClient struct {
|
||||
cc *grpc.ClientConn
|
||||
}
|
||||
|
||||
func NewHealthClient(cc *grpc.ClientConn) HealthClient {
|
||||
return &healthClient{cc}
|
||||
}
|
||||
|
||||
func (c *healthClient) GetLogsEndpoint(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*LogsEndpointResponse, error) {
|
||||
out := new(LogsEndpointResponse)
|
||||
err := c.cc.Invoke(ctx, "/ethereum.beacon.rpc.v1.Health/GetLogsEndpoint", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// HealthServer is the server API for Health service.
|
||||
type HealthServer interface {
|
||||
GetLogsEndpoint(context.Context, *types.Empty) (*LogsEndpointResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedHealthServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedHealthServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedHealthServer) GetLogsEndpoint(ctx context.Context, req *types.Empty) (*LogsEndpointResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetLogsEndpoint not implemented")
|
||||
}
|
||||
|
||||
func RegisterHealthServer(s *grpc.Server, srv HealthServer) {
|
||||
s.RegisterService(&_Health_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _Health_GetLogsEndpoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(types.Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HealthServer).GetLogsEndpoint(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ethereum.beacon.rpc.v1.Health/GetLogsEndpoint",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HealthServer).GetLogsEndpoint(ctx, req.(*types.Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Health_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "ethereum.beacon.rpc.v1.Health",
|
||||
HandlerType: (*HealthServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetLogsEndpoint",
|
||||
Handler: _Health_GetLogsEndpoint_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "proto/beacon/rpc/v1/health.proto",
|
||||
}
|
||||
|
||||
func (m *LogsEndpointResponse) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *LogsEndpointResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *LogsEndpointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if len(m.BeaconLogsEndpoint) > 0 {
|
||||
i -= len(m.BeaconLogsEndpoint)
|
||||
copy(dAtA[i:], m.BeaconLogsEndpoint)
|
||||
i = encodeVarintHealth(dAtA, i, uint64(len(m.BeaconLogsEndpoint)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintHealth(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovHealth(v)
|
||||
base := offset
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return base
|
||||
}
|
||||
func (m *LogsEndpointResponse) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.BeaconLogsEndpoint)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovHealth(uint64(l))
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
n += len(m.XXX_unrecognized)
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovHealth(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
func sozHealth(x uint64) (n int) {
|
||||
return sovHealth(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
}
|
||||
func (m *LogsEndpointResponse) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowHealth
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: LogsEndpointResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: LogsEndpointResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field BeaconLogsEndpoint", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowHealth
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthHealth
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthHealth
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.BeaconLogsEndpoint = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipHealth(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthHealth
|
||||
}
|
||||
if (iNdEx + skippy) < 0 {
|
||||
return ErrInvalidLengthHealth
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipHealth(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
depth := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowHealth
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
wireType := int(wire & 0x7)
|
||||
switch wireType {
|
||||
case 0:
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowHealth
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx++
|
||||
if dAtA[iNdEx-1] < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowHealth
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
length |= (int(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if length < 0 {
|
||||
return 0, ErrInvalidLengthHealth
|
||||
}
|
||||
iNdEx += length
|
||||
case 3:
|
||||
depth++
|
||||
case 4:
|
||||
if depth == 0 {
|
||||
return 0, ErrUnexpectedEndOfGroupHealth
|
||||
}
|
||||
depth--
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthHealth
|
||||
}
|
||||
if depth == 0 {
|
||||
return iNdEx, nil
|
||||
}
|
||||
}
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthHealth = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowHealth = fmt.Errorf("proto: integer overflow")
|
||||
ErrUnexpectedEndOfGroupHealth = fmt.Errorf("proto: unexpected end of group")
|
||||
)
|
||||
24
proto/beacon/rpc/v1/health.proto
Normal file
24
proto/beacon/rpc/v1/health.proto
Normal file
@@ -0,0 +1,24 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package ethereum.beacon.rpc.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
// Health service API
|
||||
//
|
||||
// The health service is able to return important metadata about a beacon node
|
||||
// such as the address of the logs websocket endpoint used by web clients.
|
||||
service Health {
|
||||
// Returns the websocket endpoint which can be reached to subscribe
|
||||
// to logs from the beacon node.
|
||||
rpc GetLogsEndpoint(google.protobuf.Empty) returns (LogsEndpointResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/eth/v1alpha1/health/logs/endpoint"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message LogsEndpointResponse {
|
||||
string beacon_logs_endpoint = 1;
|
||||
}
|
||||
253
proto/beacon/rpc/v1_gateway/health.pb.go
generated
Executable file
253
proto/beacon/rpc/v1_gateway/health.pb.go
generated
Executable file
@@ -0,0 +1,253 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.13.0
|
||||
// source: proto/beacon/rpc/v1/health.proto
|
||||
|
||||
package ethereum_beacon_rpc_v1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
empty "github.com/golang/protobuf/ptypes/empty"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type LogsEndpointResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
BeaconLogsEndpoint string `protobuf:"bytes,1,opt,name=beacon_logs_endpoint,json=beaconLogsEndpoint,proto3" json:"beacon_logs_endpoint,omitempty"`
|
||||
}
|
||||
|
||||
func (x *LogsEndpointResponse) Reset() {
|
||||
*x = LogsEndpointResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_beacon_rpc_v1_health_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *LogsEndpointResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*LogsEndpointResponse) ProtoMessage() {}
|
||||
|
||||
func (x *LogsEndpointResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_beacon_rpc_v1_health_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use LogsEndpointResponse.ProtoReflect.Descriptor instead.
|
||||
func (*LogsEndpointResponse) Descriptor() ([]byte, []int) {
|
||||
return file_proto_beacon_rpc_v1_health_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *LogsEndpointResponse) GetBeaconLogsEndpoint() string {
|
||||
if x != nil {
|
||||
return x.BeaconLogsEndpoint
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_proto_beacon_rpc_v1_health_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_proto_beacon_rpc_v1_health_proto_rawDesc = []byte{
|
||||
0x0a, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x72,
|
||||
0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x12, 0x16, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x62, 0x65, 0x61,
|
||||
0x63, 0x6f, 0x6e, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67,
|
||||
0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x48, 0x0a, 0x14, 0x4c, 0x6f, 0x67, 0x73, 0x45, 0x6e, 0x64,
|
||||
0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a,
|
||||
0x14, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x65, 0x6e, 0x64,
|
||||
0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x62, 0x65, 0x61,
|
||||
0x63, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x73, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x32,
|
||||
0x8e, 0x01, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x83, 0x01, 0x0a, 0x0f, 0x47,
|
||||
0x65, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x16,
|
||||
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75,
|
||||
0x6d, 0x2e, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e,
|
||||
0x4c, 0x6f, 0x67, 0x73, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x65,
|
||||
0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x68, 0x65, 0x61, 0x6c,
|
||||
0x74, 0x68, 0x2f, 0x6c, 0x6f, 0x67, 0x73, 0x2f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_proto_beacon_rpc_v1_health_proto_rawDescOnce sync.Once
|
||||
file_proto_beacon_rpc_v1_health_proto_rawDescData = file_proto_beacon_rpc_v1_health_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_proto_beacon_rpc_v1_health_proto_rawDescGZIP() []byte {
|
||||
file_proto_beacon_rpc_v1_health_proto_rawDescOnce.Do(func() {
|
||||
file_proto_beacon_rpc_v1_health_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_beacon_rpc_v1_health_proto_rawDescData)
|
||||
})
|
||||
return file_proto_beacon_rpc_v1_health_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_proto_beacon_rpc_v1_health_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_proto_beacon_rpc_v1_health_proto_goTypes = []interface{}{
|
||||
(*LogsEndpointResponse)(nil), // 0: ethereum.beacon.rpc.v1.LogsEndpointResponse
|
||||
(*empty.Empty)(nil), // 1: google.protobuf.Empty
|
||||
}
|
||||
var file_proto_beacon_rpc_v1_health_proto_depIdxs = []int32{
|
||||
1, // 0: ethereum.beacon.rpc.v1.Health.GetLogsEndpoint:input_type -> google.protobuf.Empty
|
||||
0, // 1: ethereum.beacon.rpc.v1.Health.GetLogsEndpoint:output_type -> ethereum.beacon.rpc.v1.LogsEndpointResponse
|
||||
1, // [1:2] is the sub-list for method output_type
|
||||
0, // [0:1] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_proto_beacon_rpc_v1_health_proto_init() }
|
||||
func file_proto_beacon_rpc_v1_health_proto_init() {
|
||||
if File_proto_beacon_rpc_v1_health_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_proto_beacon_rpc_v1_health_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*LogsEndpointResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_proto_beacon_rpc_v1_health_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_proto_beacon_rpc_v1_health_proto_goTypes,
|
||||
DependencyIndexes: file_proto_beacon_rpc_v1_health_proto_depIdxs,
|
||||
MessageInfos: file_proto_beacon_rpc_v1_health_proto_msgTypes,
|
||||
}.Build()
|
||||
File_proto_beacon_rpc_v1_health_proto = out.File
|
||||
file_proto_beacon_rpc_v1_health_proto_rawDesc = nil
|
||||
file_proto_beacon_rpc_v1_health_proto_goTypes = nil
|
||||
file_proto_beacon_rpc_v1_health_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ context.Context
|
||||
var _ grpc.ClientConnInterface
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion6
|
||||
|
||||
// HealthClient is the client API for Health service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type HealthClient interface {
|
||||
GetLogsEndpoint(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*LogsEndpointResponse, error)
|
||||
}
|
||||
|
||||
type healthClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewHealthClient(cc grpc.ClientConnInterface) HealthClient {
|
||||
return &healthClient{cc}
|
||||
}
|
||||
|
||||
func (c *healthClient) GetLogsEndpoint(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*LogsEndpointResponse, error) {
|
||||
out := new(LogsEndpointResponse)
|
||||
err := c.cc.Invoke(ctx, "/ethereum.beacon.rpc.v1.Health/GetLogsEndpoint", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// HealthServer is the server API for Health service.
|
||||
type HealthServer interface {
|
||||
GetLogsEndpoint(context.Context, *empty.Empty) (*LogsEndpointResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedHealthServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedHealthServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedHealthServer) GetLogsEndpoint(context.Context, *empty.Empty) (*LogsEndpointResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetLogsEndpoint not implemented")
|
||||
}
|
||||
|
||||
func RegisterHealthServer(s *grpc.Server, srv HealthServer) {
|
||||
s.RegisterService(&_Health_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _Health_GetLogsEndpoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(empty.Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HealthServer).GetLogsEndpoint(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ethereum.beacon.rpc.v1.Health/GetLogsEndpoint",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HealthServer).GetLogsEndpoint(ctx, req.(*empty.Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Health_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "ethereum.beacon.rpc.v1.Health",
|
||||
HandlerType: (*HealthServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetLogsEndpoint",
|
||||
Handler: _Health_GetLogsEndpoint_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "proto/beacon/rpc/v1/health.proto",
|
||||
}
|
||||
148
proto/beacon/rpc/v1_gateway/health.pb.gw.go
Executable file
148
proto/beacon/rpc/v1_gateway/health.pb.gw.go
Executable file
@@ -0,0 +1,148 @@
|
||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: proto/beacon/rpc/v1/health.proto
|
||||
|
||||
/*
|
||||
Package ethereum_beacon_rpc_v1 is a reverse proxy.
|
||||
|
||||
It translates gRPC into RESTful JSON APIs.
|
||||
*/
|
||||
package ethereum_beacon_rpc_v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/golang/protobuf/descriptor"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// Suppress "imported and not used" errors
|
||||
var _ codes.Code
|
||||
var _ io.Reader
|
||||
var _ status.Status
|
||||
var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
var _ = descriptor.ForMessage
|
||||
|
||||
func request_Health_GetLogsEndpoint_0(ctx context.Context, marshaler runtime.Marshaler, client HealthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq empty.Empty
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := client.GetLogsEndpoint(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Health_GetLogsEndpoint_0(ctx context.Context, marshaler runtime.Marshaler, server HealthServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq empty.Empty
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := server.GetLogsEndpoint(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterHealthHandlerServer registers the http handlers for service Health to "mux".
|
||||
// UnaryRPC :call HealthServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
func RegisterHealthHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HealthServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_Health_GetLogsEndpoint_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Health_GetLogsEndpoint_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Health_GetLogsEndpoint_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegisterHealthHandlerFromEndpoint is same as RegisterHealthHandler but
|
||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||
func RegisterHealthHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
conn, err := grpc.Dial(endpoint, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
}()
|
||||
}()
|
||||
|
||||
return RegisterHealthHandler(ctx, mux, conn)
|
||||
}
|
||||
|
||||
// RegisterHealthHandler registers the http handlers for service Health to "mux".
|
||||
// The handlers forward requests to the grpc endpoint over "conn".
|
||||
func RegisterHealthHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterHealthHandlerClient(ctx, mux, NewHealthClient(conn))
|
||||
}
|
||||
|
||||
// RegisterHealthHandlerClient registers the http handlers for service Health
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HealthClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HealthClient"
|
||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||
// "HealthClient" to call the correct interceptors.
|
||||
func RegisterHealthHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HealthClient) error {
|
||||
|
||||
mux.Handle("GET", pattern_Health_GetLogsEndpoint_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Health_GetLogsEndpoint_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Health_GetLogsEndpoint_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_Health_GetLogsEndpoint_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "health", "logs", "endpoint"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_Health_GetLogsEndpoint_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
121
proto/slashing/slashing.pb.go
generated
121
proto/slashing/slashing.pb.go
generated
@@ -453,48 +453,49 @@ func init() {
|
||||
func init() { proto.RegisterFile("proto/slashing/slashing.proto", fileDescriptor_da7e95107d0081b4) }
|
||||
|
||||
var fileDescriptor_da7e95107d0081b4 = []byte{
|
||||
// 641 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcd, 0x6e, 0xd3, 0x4c,
|
||||
0x14, 0x95, 0x9b, 0x7e, 0x1f, 0xf4, 0x36, 0x40, 0x3a, 0x54, 0x28, 0x44, 0x25, 0x2d, 0x46, 0x88,
|
||||
0x56, 0x50, 0xa7, 0x2d, 0x1b, 0x60, 0x45, 0x23, 0x21, 0x35, 0x1b, 0x40, 0x69, 0x11, 0x4b, 0x6b,
|
||||
0x6c, 0xdf, 0xda, 0xa3, 0xba, 0x1e, 0x33, 0x73, 0x53, 0xc8, 0x7b, 0xb0, 0xe3, 0x51, 0x78, 0x01,
|
||||
0x96, 0x3c, 0x01, 0x42, 0x7d, 0x00, 0x1e, 0x80, 0x15, 0xf2, 0xd8, 0x49, 0xdc, 0xda, 0x41, 0x74,
|
||||
0x37, 0x73, 0x7f, 0xce, 0xb9, 0x3f, 0x67, 0x06, 0xee, 0xa5, 0x4a, 0x92, 0xec, 0xe9, 0x98, 0xeb,
|
||||
0x48, 0x24, 0xe1, 0xf4, 0xe0, 0x18, 0x3b, 0x5b, 0x41, 0x8a, 0x50, 0xe1, 0xe8, 0xd4, 0x99, 0x38,
|
||||
0x3a, 0xeb, 0x48, 0x51, 0xef, 0x6c, 0x97, 0xc7, 0x69, 0xc4, 0x77, 0x7b, 0x1e, 0x72, 0x5f, 0x26,
|
||||
0xae, 0x17, 0x4b, 0xff, 0x24, 0xcf, 0xe9, 0x6c, 0x87, 0x82, 0xa2, 0x91, 0xe7, 0xf8, 0xf2, 0xb4,
|
||||
0x17, 0xca, 0x50, 0xf6, 0x8c, 0xd9, 0x1b, 0x1d, 0x9b, 0x5b, 0xce, 0x97, 0x9d, 0xf2, 0x70, 0xfb,
|
||||
0x25, 0xdc, 0x3d, 0x10, 0x61, 0x84, 0x9a, 0xf6, 0x89, 0x50, 0x13, 0x27, 0x21, 0x93, 0x21, 0x7e,
|
||||
0x18, 0xa1, 0x26, 0xf6, 0x00, 0x6e, 0x9c, 0xf1, 0x58, 0x04, 0x9c, 0xa4, 0x72, 0x45, 0xa0, 0xdb,
|
||||
0xd6, 0x46, 0x63, 0x73, 0x71, 0xd8, 0x9c, 0x1a, 0x07, 0x81, 0xb6, 0x43, 0xe8, 0xd4, 0x21, 0xe8,
|
||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cc, 0x99, 0xc3, 0x75, 0x28,
|
||||
0xc2, 0x04, 0x83, 0xbe, 0xf9, 0xd1, 0x4c, 0xe4, 0x01, 0xf2, 0x00, 0x55, 0x2d, 0xe1, 0xdc, 0x97,
|
||||
0x26, 0xa0, 0x5b, 0xdf, 0xe2, 0x6b, 0xf9, 0x2e, 0x0d, 0x38, 0xe1, 0x55, 0x5a, 0x5d, 0xab, 0x61,
|
||||
0x9e, 0xbd, 0x38, 0x0f, 0xda, 0x97, 0x7b, 0x9b, 0x92, 0x6c, 0xce, 0x21, 0xa9, 0x76, 0xf7, 0x57,
|
||||
0x8e, 0x7e, 0xf3, 0xdb, 0x79, 0xd7, 0xfa, 0x7e, 0xde, 0xb5, 0x7e, 0x9e, 0x77, 0x2d, 0xef, 0x7f,
|
||||
0xf3, 0x65, 0x3f, 0xfd, 0x13, 0x00, 0x00, 0xff, 0xff, 0x27, 0x68, 0xae, 0x2c, 0x36, 0x06, 0x00,
|
||||
0x00,
|
||||
// 661 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xdd, 0x4e, 0xd4, 0x40,
|
||||
0x14, 0x4e, 0x01, 0x7f, 0x18, 0x56, 0x5d, 0x06, 0x62, 0xd6, 0x0d, 0x2e, 0x58, 0x63, 0x84, 0x08,
|
||||
0x5d, 0xc0, 0x1b, 0xf5, 0x4a, 0x36, 0x31, 0x61, 0x6f, 0xd4, 0x2c, 0x18, 0x2f, 0x9b, 0x69, 0x7b,
|
||||
0x68, 0x27, 0x94, 0x4e, 0x9d, 0x39, 0x8b, 0xee, 0x7b, 0x78, 0xe7, 0x43, 0xf8, 0x1a, 0x5e, 0xfa,
|
||||
0x04, 0xc6, 0xf0, 0x00, 0x3e, 0x80, 0x57, 0xa6, 0x33, 0xed, 0x6e, 0xa1, 0x5d, 0xb3, 0xdc, 0x4d,
|
||||
0xcf, 0xdf, 0x77, 0xce, 0x77, 0xbe, 0x99, 0x92, 0x87, 0xa9, 0x14, 0x28, 0xba, 0x2a, 0x66, 0x2a,
|
||||
0xe2, 0x49, 0x38, 0x3e, 0x38, 0xda, 0x4e, 0x97, 0x01, 0x23, 0x90, 0x30, 0x3c, 0x73, 0x0a, 0x47,
|
||||
0x7b, 0x1d, 0x30, 0xea, 0x9e, 0xef, 0xb1, 0x38, 0x8d, 0xd8, 0x5e, 0xd7, 0x03, 0xe6, 0x8b, 0xc4,
|
||||
0xf5, 0x62, 0xe1, 0x9f, 0x9a, 0x9c, 0xf6, 0x4e, 0xc8, 0x31, 0x1a, 0x7a, 0x8e, 0x2f, 0xce, 0xba,
|
||||
0xa1, 0x08, 0x45, 0x57, 0x9b, 0xbd, 0xe1, 0x89, 0xfe, 0x32, 0x78, 0xd9, 0xc9, 0x84, 0xdb, 0xaf,
|
||||
0xc9, 0x83, 0x43, 0x1e, 0x46, 0xa0, 0xf0, 0x00, 0x11, 0x14, 0x32, 0xe4, 0x22, 0x19, 0xc0, 0xa7,
|
||||
0x21, 0x28, 0xa4, 0x8f, 0xc9, 0x9d, 0x73, 0x16, 0xf3, 0x80, 0xa1, 0x90, 0x2e, 0x0f, 0x54, 0xcb,
|
||||
0xda, 0x98, 0xdf, 0x5c, 0x18, 0x34, 0xc6, 0xc6, 0x7e, 0xa0, 0xec, 0x90, 0xb4, 0xeb, 0x2a, 0xa8,
|
||||
0x54, 0x24, 0x0a, 0x68, 0x9f, 0x34, 0xd8, 0xc4, 0x6c, 0x2a, 0x2c, 0xed, 0x3f, 0x71, 0x2a, 0x93,
|
||||
0x39, 0x35, 0x45, 0x2e, 0xa5, 0xda, 0xdf, 0x2c, 0x42, 0xab, 0x41, 0xf4, 0x11, 0x69, 0x94, 0x9b,
|
||||
0x6c, 0x59, 0x1b, 0xd6, 0xe6, 0xc2, 0x60, 0xa9, 0xd4, 0x23, 0xdd, 0x25, 0xab, 0x91, 0x49, 0x74,
|
||||
0x95, 0x18, 0x4a, 0x1f, 0x5c, 0x48, 0x85, 0x1f, 0xb5, 0xe6, 0x74, 0x28, 0xcd, 0x7d, 0x47, 0xda,
|
||||
0xf5, 0x26, 0xf3, 0x94, 0x33, 0x90, 0xc9, 0x10, 0x30, 0xcf, 0x98, 0xbf, 0x94, 0x71, 0xac, 0x5d,
|
||||
0x3a, 0xc3, 0x4e, 0x49, 0xeb, 0xbd, 0x14, 0xa9, 0x50, 0x20, 0x8f, 0xf2, 0x91, 0xc6, 0x24, 0x1c,
|
||||
0x93, 0xe5, 0x34, 0xf7, 0xb9, 0xc5, 0xbc, 0x39, 0x13, 0x4f, 0x27, 0x4c, 0x00, 0x46, 0x4e, 0xb1,
|
||||
0x59, 0xa7, 0x52, 0xab, 0x99, 0x5e, 0xb1, 0xd8, 0x5b, 0x64, 0x51, 0x9f, 0x99, 0x17, 0x03, 0x5d,
|
||||
0x23, 0x8b, 0xaa, 0xf8, 0xd0, 0x14, 0xdc, 0x1e, 0x4c, 0x0c, 0x59, 0x73, 0x86, 0xb2, 0xfa, 0xe6,
|
||||
0x58, 0xee, 0x9b, 0xb5, 0xb9, 0x4a, 0xad, 0x26, 0xbb, 0x62, 0xb1, 0xbf, 0x5a, 0xe4, 0x9e, 0x99,
|
||||
0x81, 0xc5, 0x87, 0x5c, 0xa1, 0x90, 0x23, 0xfa, 0x8e, 0x10, 0xcd, 0xa2, 0xeb, 0x71, 0x54, 0xba,
|
||||
0xc9, 0x46, 0x6f, 0xf7, 0xef, 0xaf, 0xf5, 0xed, 0x92, 0x64, 0x53, 0x39, 0x52, 0x67, 0x0c, 0xb9,
|
||||
0x1f, 0x33, 0x4f, 0x75, 0x43, 0xb1, 0xe3, 0x71, 0x3c, 0xe1, 0x10, 0x07, 0x4e, 0x8f, 0x63, 0xcc,
|
||||
0x15, 0x0e, 0x16, 0x75, 0x8d, 0x1e, 0x47, 0x95, 0x6d, 0x29, 0x66, 0x19, 0xb0, 0xd9, 0x8e, 0xfb,
|
||||
0x59, 0x72, 0x44, 0x48, 0x8a, 0xbd, 0x1a, 0x9f, 0x5e, 0xcf, 0x47, 0xe3, 0xb1, 0xff, 0x58, 0x84,
|
||||
0x96, 0xc4, 0x53, 0x74, 0xe6, 0x93, 0x66, 0xbe, 0x66, 0x14, 0xb9, 0x44, 0x72, 0x0a, 0x5e, 0xd6,
|
||||
0x28, 0xb5, 0x5a, 0xc0, 0x31, 0x4a, 0x38, 0x16, 0xb9, 0x86, 0x12, 0x94, 0xa3, 0xc1, 0x5d, 0xbc,
|
||||
0x64, 0xbc, 0x7e, 0xb7, 0xed, 0x03, 0xb2, 0x52, 0x53, 0x98, 0x36, 0xc9, 0xfc, 0x29, 0x8c, 0x72,
|
||||
0xa1, 0x67, 0x47, 0xba, 0x4a, 0x6e, 0x9c, 0xb3, 0x78, 0x08, 0x79, 0x2d, 0xf3, 0xf1, 0x6a, 0xee,
|
||||
0x85, 0xb5, 0xff, 0x7d, 0x81, 0xdc, 0xd2, 0x4b, 0x01, 0x49, 0x53, 0x72, 0xbf, 0xaf, 0xc6, 0x92,
|
||||
0x29, 0xdf, 0xa1, 0xad, 0x29, 0x8b, 0xee, 0x27, 0x01, 0x7c, 0x81, 0xa0, 0x14, 0xda, 0x7e, 0x36,
|
||||
0x95, 0x90, 0x1a, 0x6d, 0x09, 0xd2, 0x2c, 0x21, 0xf6, 0xb2, 0x67, 0x8a, 0x3a, 0x53, 0xb0, 0x8e,
|
||||
0x78, 0x98, 0x40, 0xd0, 0xd3, 0x2f, 0x9a, 0x8e, 0x3c, 0x04, 0x16, 0x80, 0xac, 0x05, 0x9c, 0x7a,
|
||||
0xd3, 0x38, 0xe9, 0xd4, 0x8f, 0xf8, 0x56, 0x7c, 0x48, 0x03, 0x86, 0x70, 0x9d, 0x51, 0xd7, 0x6a,
|
||||
0x90, 0x27, 0x37, 0xce, 0x23, 0xad, 0xab, 0xb3, 0x8d, 0x41, 0x36, 0xa7, 0x80, 0x54, 0xa7, 0xfb,
|
||||
0x3f, 0x86, 0x24, 0x2b, 0xd5, 0x17, 0x4f, 0xd1, 0xed, 0xd9, 0x9e, 0x4f, 0xf3, 0x8a, 0xb7, 0x77,
|
||||
0x66, 0x8c, 0x36, 0x14, 0xf6, 0x1a, 0x3f, 0x2e, 0x3a, 0xd6, 0xcf, 0x8b, 0x8e, 0xf5, 0xfb, 0xa2,
|
||||
0x63, 0x79, 0x37, 0xf5, 0x6f, 0xe2, 0xf9, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe6, 0x5a, 0x08,
|
||||
0xcf, 0xaa, 0x06, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -513,6 +514,7 @@ type SlasherClient interface {
|
||||
IsSlashableBlock(ctx context.Context, in *v1alpha1.SignedBeaconBlockHeader, opts ...grpc.CallOption) (*ProposerSlashingResponse, error)
|
||||
IsSlashableAttestationNoUpdate(ctx context.Context, in *v1alpha1.IndexedAttestation, opts ...grpc.CallOption) (*Slashable, error)
|
||||
IsSlashableBlockNoUpdate(ctx context.Context, in *v1alpha1.BeaconBlockHeader, opts ...grpc.CallOption) (*Slashable, error)
|
||||
HighestAttestations(ctx context.Context, in *HighestAttestationRequest, opts ...grpc.CallOption) (*HighestAttestationResponse, error)
|
||||
}
|
||||
|
||||
type slasherClient struct {
|
||||
@@ -559,12 +561,22 @@ func (c *slasherClient) IsSlashableBlockNoUpdate(ctx context.Context, in *v1alph
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *slasherClient) HighestAttestations(ctx context.Context, in *HighestAttestationRequest, opts ...grpc.CallOption) (*HighestAttestationResponse, error) {
|
||||
out := new(HighestAttestationResponse)
|
||||
err := c.cc.Invoke(ctx, "/ethereum.slashing.Slasher/HighestAttestations", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// SlasherServer is the server API for Slasher service.
|
||||
type SlasherServer interface {
|
||||
IsSlashableAttestation(context.Context, *v1alpha1.IndexedAttestation) (*AttesterSlashingResponse, error)
|
||||
IsSlashableBlock(context.Context, *v1alpha1.SignedBeaconBlockHeader) (*ProposerSlashingResponse, error)
|
||||
IsSlashableAttestationNoUpdate(context.Context, *v1alpha1.IndexedAttestation) (*Slashable, error)
|
||||
IsSlashableBlockNoUpdate(context.Context, *v1alpha1.BeaconBlockHeader) (*Slashable, error)
|
||||
HighestAttestations(context.Context, *HighestAttestationRequest) (*HighestAttestationResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedSlasherServer can be embedded to have forward compatible implementations.
|
||||
@@ -583,6 +595,9 @@ func (*UnimplementedSlasherServer) IsSlashableAttestationNoUpdate(ctx context.Co
|
||||
func (*UnimplementedSlasherServer) IsSlashableBlockNoUpdate(ctx context.Context, req *v1alpha1.BeaconBlockHeader) (*Slashable, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method IsSlashableBlockNoUpdate not implemented")
|
||||
}
|
||||
func (*UnimplementedSlasherServer) HighestAttestations(ctx context.Context, req *HighestAttestationRequest) (*HighestAttestationResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method HighestAttestations not implemented")
|
||||
}
|
||||
|
||||
func RegisterSlasherServer(s *grpc.Server, srv SlasherServer) {
|
||||
s.RegisterService(&_Slasher_serviceDesc, srv)
|
||||
@@ -660,6 +675,24 @@ func _Slasher_IsSlashableBlockNoUpdate_Handler(srv interface{}, ctx context.Cont
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Slasher_HighestAttestations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(HighestAttestationRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SlasherServer).HighestAttestations(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ethereum.slashing.Slasher/HighestAttestations",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SlasherServer).HighestAttestations(ctx, req.(*HighestAttestationRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Slasher_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "ethereum.slashing.Slasher",
|
||||
HandlerType: (*SlasherServer)(nil),
|
||||
@@ -680,6 +713,10 @@ var _Slasher_serviceDesc = grpc.ServiceDesc{
|
||||
MethodName: "IsSlashableBlockNoUpdate",
|
||||
Handler: _Slasher_IsSlashableBlockNoUpdate_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "HighestAttestations",
|
||||
Handler: _Slasher_HighestAttestations_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "proto/slashing/slashing.proto",
|
||||
|
||||
@@ -25,6 +25,10 @@ service Slasher {
|
||||
// Returns if a given beacon block header could be slashable when compared to the slashers history for the proposer.
|
||||
// This function is read-only, and does not need the beacon block header to be signed.
|
||||
rpc IsSlashableBlockNoUpdate(ethereum.eth.v1alpha1.BeaconBlockHeader) returns (Slashable);
|
||||
|
||||
// Returns the highest source and target attestation for validator indexes that have been observed by the slasher.
|
||||
rpc HighestAttestations(HighestAttestationRequest) returns (HighestAttestationResponse);
|
||||
|
||||
}
|
||||
|
||||
message HighestAttestationRequest {
|
||||
|
||||
@@ -12,7 +12,6 @@ import (
|
||||
"github.com/prysmaticlabs/go-ssz"
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/state"
|
||||
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
||||
webpb "github.com/prysmaticlabs/prysm/proto/validator/accounts/v2"
|
||||
"github.com/prysmaticlabs/prysm/shared/params/spectest"
|
||||
"github.com/prysmaticlabs/prysm/shared/testutil"
|
||||
"github.com/prysmaticlabs/prysm/shared/testutil/require"
|
||||
@@ -105,10 +104,11 @@ func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (i
|
||||
obj = ðpb.Checkpoint{}
|
||||
case "Deposit":
|
||||
obj = ðpb.Deposit{}
|
||||
case "DepositMessage":
|
||||
t.Skip("Unused type")
|
||||
return nil, nil
|
||||
case "DepositData":
|
||||
obj = ðpb.Deposit_Data{}
|
||||
case "DepositMessage":
|
||||
obj = &webpb.DepositMessage{}
|
||||
case "Eth1Data":
|
||||
obj = ðpb.Eth1Data{}
|
||||
case "Eth1Block":
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
load("@prysm//tools/go:def.bzl", "go_library")
|
||||
load("@rules_proto//proto:defs.bzl", "proto_library")
|
||||
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
|
||||
load("@com_github_prysmaticlabs_ethereumapis//tools:ssz.bzl", "SSZ_DEPS", "ssz_gen_marshal")
|
||||
|
||||
# gazelle:ignore
|
||||
proto_library(
|
||||
@@ -19,14 +18,6 @@ proto_library(
|
||||
],
|
||||
)
|
||||
|
||||
ssz_gen_marshal(
|
||||
name = "ssz_generated_files",
|
||||
go_proto = ":ethereum_validator_account_go_proto",
|
||||
objs = [
|
||||
"DepositMessage",
|
||||
],
|
||||
)
|
||||
|
||||
go_proto_library(
|
||||
name = "ethereum_validator_account_gateway_proto",
|
||||
compilers = [
|
||||
@@ -61,9 +52,7 @@ go_proto_library(
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [":ssz_generated_files"],
|
||||
embed = [":ethereum_validator_account_go_proto"],
|
||||
importpath = "github.com/prysmaticlabs/prysm/proto/validator/accounts/v2",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = SSZ_DEPS,
|
||||
)
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
// Code generated by fastssz. DO NOT EDIT.
|
||||
package ethereum_validator_accounts_v2
|
||||
|
||||
import (
|
||||
ssz "github.com/ferranbt/fastssz"
|
||||
)
|
||||
|
||||
// MarshalSSZ ssz marshals the DepositMessage object
|
||||
func (d *DepositMessage) MarshalSSZ() ([]byte, error) {
|
||||
return ssz.MarshalSSZ(d)
|
||||
}
|
||||
|
||||
// MarshalSSZTo ssz marshals the DepositMessage object to a target array
|
||||
func (d *DepositMessage) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
||||
dst = buf
|
||||
|
||||
// Field (0) 'Pubkey'
|
||||
if len(d.Pubkey) != 48 {
|
||||
err = ssz.ErrBytesLength
|
||||
return
|
||||
}
|
||||
dst = append(dst, d.Pubkey...)
|
||||
|
||||
// Field (1) 'WithdrawalCredentials'
|
||||
if len(d.WithdrawalCredentials) != 32 {
|
||||
err = ssz.ErrBytesLength
|
||||
return
|
||||
}
|
||||
dst = append(dst, d.WithdrawalCredentials...)
|
||||
|
||||
// Field (2) 'Amount'
|
||||
dst = ssz.MarshalUint64(dst, d.Amount)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UnmarshalSSZ ssz unmarshals the DepositMessage object
|
||||
func (d *DepositMessage) UnmarshalSSZ(buf []byte) error {
|
||||
var err error
|
||||
size := uint64(len(buf))
|
||||
if size != 88 {
|
||||
return ssz.ErrSize
|
||||
}
|
||||
|
||||
// Field (0) 'Pubkey'
|
||||
if cap(d.Pubkey) == 0 {
|
||||
d.Pubkey = make([]byte, 0, len(buf[0:48]))
|
||||
}
|
||||
d.Pubkey = append(d.Pubkey, buf[0:48]...)
|
||||
|
||||
// Field (1) 'WithdrawalCredentials'
|
||||
if cap(d.WithdrawalCredentials) == 0 {
|
||||
d.WithdrawalCredentials = make([]byte, 0, len(buf[48:80]))
|
||||
}
|
||||
d.WithdrawalCredentials = append(d.WithdrawalCredentials, buf[48:80]...)
|
||||
|
||||
// Field (2) 'Amount'
|
||||
d.Amount = ssz.UnmarshallUint64(buf[80:88])
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// SizeSSZ returns the ssz encoded size in bytes for the DepositMessage object
|
||||
func (d *DepositMessage) SizeSSZ() (size int) {
|
||||
size = 88
|
||||
return
|
||||
}
|
||||
|
||||
// HashTreeRoot ssz hashes the DepositMessage object
|
||||
func (d *DepositMessage) HashTreeRoot() ([32]byte, error) {
|
||||
return ssz.HashWithDefaultHasher(d)
|
||||
}
|
||||
|
||||
// HashTreeRootWith ssz hashes the DepositMessage object with a hasher
|
||||
func (d *DepositMessage) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
indx := hh.Index()
|
||||
|
||||
// Field (0) 'Pubkey'
|
||||
if len(d.Pubkey) != 48 {
|
||||
err = ssz.ErrBytesLength
|
||||
return
|
||||
}
|
||||
hh.PutBytes(d.Pubkey)
|
||||
|
||||
// Field (1) 'WithdrawalCredentials'
|
||||
if len(d.WithdrawalCredentials) != 32 {
|
||||
err = ssz.ErrBytesLength
|
||||
return
|
||||
}
|
||||
hh.PutBytes(d.WithdrawalCredentials)
|
||||
|
||||
// Field (2) 'Amount'
|
||||
hh.PutUint64(d.Amount)
|
||||
|
||||
hh.Merkleize(indx)
|
||||
return
|
||||
}
|
||||
1850
proto/validator/accounts/v2/web_api.pb.go
generated
1850
proto/validator/accounts/v2/web_api.pb.go
generated
File diff suppressed because it is too large
Load Diff
@@ -5,25 +5,13 @@ import "google/api/annotations.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
||||
|
||||
|
||||
service Wallet {
|
||||
rpc HasWallet(google.protobuf.Empty) returns (HasWalletResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/v2/validator/wallet/exists"
|
||||
};
|
||||
}
|
||||
rpc CreateWallet(CreateWalletRequest) returns (CreateWalletResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/v2/validator/wallet/create",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc EditConfig(EditWalletConfigRequest) returns (WalletResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/v2/validator/wallet/config/edit",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc WalletConfig(google.protobuf.Empty) returns (WalletResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/v2/validator/wallet"
|
||||
@@ -62,9 +50,19 @@ service Health {
|
||||
get: "/v2/validator/health/node_connection"
|
||||
};
|
||||
}
|
||||
rpc GetLogsEndpoints(google.protobuf.Empty) returns (LogsEndpointResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/v2/validator/health/logs/endpoints"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
service Auth {
|
||||
rpc HasUsedWeb(google.protobuf.Empty) returns (HasUsedWebResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/v2/validator/initialized",
|
||||
};
|
||||
}
|
||||
rpc Login(AuthRequest) returns (AuthResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/v2/validator/login",
|
||||
@@ -94,29 +92,27 @@ enum KeymanagerKind {
|
||||
|
||||
message CreateWalletRequest {
|
||||
// Path on disk where the wallet will be stored.
|
||||
string wallet_path = 1;
|
||||
KeymanagerKind keymanager = 2;
|
||||
KeymanagerKind keymanager = 1;
|
||||
|
||||
// Password for the wallet.
|
||||
string wallet_password = 3;
|
||||
string wallet_password = 2;
|
||||
// Mnemonic in case the user is creating a derived wallet.
|
||||
string mnemonic = 4;
|
||||
string mnemonic = 3;
|
||||
// Number of accounts.
|
||||
uint64 num_accounts = 5;
|
||||
uint64 num_accounts = 4;
|
||||
|
||||
// Remote address such as host.example.com:4000 for a gRPC remote signer server.
|
||||
string remote_addr = 6;
|
||||
string remote_addr = 5;
|
||||
// Path to client.crt for secure TLS connections to a remote signer server.
|
||||
string remote_crt_path = 7;
|
||||
string remote_crt_path = 6;
|
||||
// Path to client.key for secure TLS connections to a remote signer server.
|
||||
string remote_key_path = 8;
|
||||
string remote_key_path = 7;
|
||||
// Path to ca.crt for secure TLS connections to a remote signer server.
|
||||
string remote_ca_crt_path = 9;
|
||||
string remote_ca_crt_path = 8;
|
||||
}
|
||||
|
||||
message CreateWalletResponse {
|
||||
WalletResponse wallet = 1;
|
||||
DepositDataResponse accounts_created = 2;
|
||||
}
|
||||
|
||||
message EditWalletConfigRequest {
|
||||
@@ -184,7 +180,7 @@ message AccountRequest {
|
||||
|
||||
message AuthRequest {
|
||||
string password = 1;
|
||||
string wallet_dir = 2;
|
||||
string password_confirmation = 2;
|
||||
}
|
||||
|
||||
message AuthResponse {
|
||||
@@ -207,6 +203,11 @@ message NodeConnectionResponse {
|
||||
bytes deposit_contract_address = 5;
|
||||
}
|
||||
|
||||
message LogsEndpointResponse {
|
||||
string validator_logs_endpoint = 1;
|
||||
string beacon_logs_endpoint = 2;
|
||||
}
|
||||
|
||||
message ChangePasswordRequest {
|
||||
string current_password = 1;
|
||||
string password = 2;
|
||||
@@ -230,28 +231,8 @@ message ImportKeystoresResponse {
|
||||
repeated bytes imported_public_keys = 1;
|
||||
}
|
||||
|
||||
message DepositMessage {
|
||||
bytes pubkey = 1 [(gogoproto.moretags) = "ssz-size:\"48\""];
|
||||
bytes withdrawal_credentials = 2 [(gogoproto.moretags) = "ssz-size:\"32\""];
|
||||
uint64 amount = 3;
|
||||
message HasUsedWebResponse {
|
||||
bool has_signed_up = 1;
|
||||
bool has_wallet = 2;
|
||||
}
|
||||
|
||||
message DepositDataResponse {
|
||||
// The deposit data for each created account
|
||||
// represented as a list in the same format as
|
||||
// the deposit_data.json file from the eth2.0-deposit-cli.
|
||||
repeated DepositData deposit_data_list = 1;
|
||||
message DepositData {
|
||||
map<string, string> data = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message DeleteAccountsRequest {
|
||||
// List of public keys to delete.
|
||||
repeated bytes public_keys = 1;
|
||||
}
|
||||
|
||||
message DeleteAccountsResponse {
|
||||
// List of public keys successfully deleted.
|
||||
repeated bytes deleted_keys = 1;
|
||||
}
|
||||
|
||||
1198
proto/validator/accounts/v2_gateway/web_api.pb.go
generated
1198
proto/validator/accounts/v2_gateway/web_api.pb.go
generated
File diff suppressed because it is too large
Load Diff
@@ -32,24 +32,6 @@ var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
var _ = descriptor.ForMessage
|
||||
|
||||
func request_Wallet_HasWallet_0(ctx context.Context, marshaler runtime.Marshaler, client WalletClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq empty.Empty
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := client.HasWallet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Wallet_HasWallet_0(ctx context.Context, marshaler runtime.Marshaler, server WalletServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq empty.Empty
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := server.HasWallet(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_Wallet_CreateWallet_0(ctx context.Context, marshaler runtime.Marshaler, client WalletClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq CreateWalletRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
@@ -84,40 +66,6 @@ func local_request_Wallet_CreateWallet_0(ctx context.Context, marshaler runtime.
|
||||
|
||||
}
|
||||
|
||||
func request_Wallet_EditConfig_0(ctx context.Context, marshaler runtime.Marshaler, client WalletClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq EditWalletConfigRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.EditConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Wallet_EditConfig_0(ctx context.Context, marshaler runtime.Marshaler, server WalletServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq EditWalletConfigRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.EditConfig(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_Wallet_WalletConfig_0(ctx context.Context, marshaler runtime.Marshaler, client WalletClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq empty.Empty
|
||||
var metadata runtime.ServerMetadata
|
||||
@@ -276,6 +224,42 @@ func local_request_Health_GetBeaconNodeConnection_0(ctx context.Context, marshal
|
||||
|
||||
}
|
||||
|
||||
func request_Health_GetLogsEndpoints_0(ctx context.Context, marshaler runtime.Marshaler, client HealthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq empty.Empty
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := client.GetLogsEndpoints(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Health_GetLogsEndpoints_0(ctx context.Context, marshaler runtime.Marshaler, server HealthServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq empty.Empty
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := server.GetLogsEndpoints(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_Auth_HasUsedWeb_0(ctx context.Context, marshaler runtime.Marshaler, client AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq empty.Empty
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := client.HasUsedWeb(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Auth_HasUsedWeb_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq empty.Empty
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := server.HasUsedWeb(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_Auth_Login_0(ctx context.Context, marshaler runtime.Marshaler, client AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq AuthRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
@@ -383,26 +367,6 @@ func local_request_Auth_Logout_0(ctx context.Context, marshaler runtime.Marshale
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
func RegisterWalletHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WalletServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_Wallet_HasWallet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Wallet_HasWallet_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Wallet_HasWallet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Wallet_CreateWallet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
@@ -423,26 +387,6 @@ func RegisterWalletHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Wallet_EditConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Wallet_EditConfig_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Wallet_EditConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Wallet_WalletConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
@@ -579,6 +523,26 @@ func RegisterHealthHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Health_GetLogsEndpoints_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Health_GetLogsEndpoints_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Health_GetLogsEndpoints_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -587,6 +551,26 @@ func RegisterHealthHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_Auth_HasUsedWeb_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Auth_HasUsedWeb_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Auth_HasUsedWeb_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Auth_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
@@ -688,26 +672,6 @@ func RegisterWalletHandler(ctx context.Context, mux *runtime.ServeMux, conn *grp
|
||||
// "WalletClient" to call the correct interceptors.
|
||||
func RegisterWalletHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WalletClient) error {
|
||||
|
||||
mux.Handle("GET", pattern_Wallet_HasWallet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Wallet_HasWallet_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Wallet_HasWallet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Wallet_CreateWallet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
@@ -728,26 +692,6 @@ func RegisterWalletHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Wallet_EditConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Wallet_EditConfig_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Wallet_EditConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Wallet_WalletConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
@@ -812,12 +756,8 @@ func RegisterWalletHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_Wallet_HasWallet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "validator", "wallet", "exists"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Wallet_CreateWallet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "validator", "wallet", "create"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Wallet_EditConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v2", "validator", "wallet", "config", "edit"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Wallet_WalletConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "validator", "wallet"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Wallet_GenerateMnemonic_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "validator", "mnemonic", "generate"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
@@ -826,12 +766,8 @@ var (
|
||||
)
|
||||
|
||||
var (
|
||||
forward_Wallet_HasWallet_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Wallet_CreateWallet_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Wallet_EditConfig_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Wallet_WalletConfig_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Wallet_GenerateMnemonic_0 = runtime.ForwardResponseMessage
|
||||
@@ -990,15 +926,39 @@ func RegisterHealthHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Health_GetLogsEndpoints_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Health_GetLogsEndpoints_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Health_GetLogsEndpoints_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_Health_GetBeaconNodeConnection_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "validator", "health", "node_connection"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Health_GetLogsEndpoints_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v2", "validator", "health", "logs", "endpoints"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_Health_GetBeaconNodeConnection_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Health_GetLogsEndpoints_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
|
||||
// RegisterAuthHandlerFromEndpoint is same as RegisterAuthHandler but
|
||||
@@ -1039,6 +999,26 @@ func RegisterAuthHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.
|
||||
// "AuthClient" to call the correct interceptors.
|
||||
func RegisterAuthHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthClient) error {
|
||||
|
||||
mux.Handle("GET", pattern_Auth_HasUsedWeb_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Auth_HasUsedWeb_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Auth_HasUsedWeb_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Auth_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
@@ -1103,6 +1083,8 @@ func RegisterAuthHandlerClient(ctx context.Context, mux *runtime.ServeMux, clien
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_Auth_HasUsedWeb_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "validator", "initialized"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Auth_Login_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "validator", "login"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Auth_Signup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "validator", "signup"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
@@ -1111,6 +1093,8 @@ var (
|
||||
)
|
||||
|
||||
var (
|
||||
forward_Auth_HasUsedWeb_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Auth_Login_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Auth_Signup_0 = runtime.ForwardResponseMessage
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
# Bash Scripts
|
||||
|
||||
This subproject contains useful bash scripts for working with our repository. We have a simple tool that outputs coverage, a simple tool to check for gazelle requirements, and visibility rules tools for Bazel packages.
|
||||
|
||||
### Instructions to run a single beacon chain node and 8 validators locally using the scripts.
|
||||
|
||||
1. Ensure your private key path is correct in all the files below.
|
||||
|
||||
2. Run `./deploy-deposit-contract.sh`
|
||||
|
||||
3. Put the resulting contract address in `start-beacon-chain.sh` and `setup-8-validators.sh`.
|
||||
|
||||
4. Run `./start-beacon-chain.sh`
|
||||
|
||||
5. Run `./setup-8-validators.sh`
|
||||
|
||||
6. You can use `tail -f /tmp/data/validator#.log` with # as a number from 1 - 8 to view the output of the validators.
|
||||
This subproject contains useful bash scripts for working with our repository. We have a simple tool that outputs coverage, a simple tool to check for gazelle requirements, update Go protobuf generated files, visibility rules tools for Bazel packages, and more.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Continuous integration script to check that TODOs are in the correct format
|
||||
OUTPUT="$(grep -PrinH '(?<!context\.)todo(?!\(#{0,1}\d+\))' --include \*.go --exclude *site_data.go *)";
|
||||
OUTPUT="$(grep -PrinH '(?<!context\.)todo(?!\(#{0,1}\d+\))' --include \*.go --exclude *site_data.go --exclude *mainnet_config.go *)";
|
||||
if [ "$OUTPUT" != "" ] ;
|
||||
then
|
||||
echo "Invalid TODOs found. Failing." >&2;
|
||||
|
||||
@@ -13,10 +13,10 @@ import (
|
||||
"github.com/prysmaticlabs/prysm/shared/params"
|
||||
)
|
||||
|
||||
var maxKeys = int64(100000)
|
||||
var maxKeys = int64(1000000)
|
||||
var pubkeyCache, _ = ristretto.NewCache(&ristretto.Config{
|
||||
NumCounters: maxKeys,
|
||||
MaxCost: 1 << 22, // ~4mb is cache max size
|
||||
MaxCost: 1 << 26, // ~64mb is cache max size
|
||||
BufferItems: 64,
|
||||
})
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/prysmaticlabs/prysm/shared/params"
|
||||
"github.com/urfave/cli/v2"
|
||||
"github.com/urfave/cli/v2/altsrc"
|
||||
)
|
||||
@@ -84,12 +85,7 @@ var (
|
||||
BootstrapNode = &cli.StringSliceFlag{
|
||||
Name: "bootstrap-node",
|
||||
Usage: "The address of bootstrap node. Beacon node will connect for peer discovery via DHT. Multiple nodes can be passed by using the flag multiple times but not comma-separated. You can also pass YAML files containing multiple nodes.",
|
||||
Value: cli.NewStringSlice(
|
||||
// Discv5
|
||||
"enr:-Ku4QMKVC_MowDsmEa20d5uGjrChI0h8_KsKXDmgVQbIbngZV0idV6_RL7fEtZGo-kTNZ5o7_EJI_vCPJ6scrhwX0Z4Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQJxCnE6v_x2ekgY_uoE1rtwzvGy40mq9eD66XfHPBWgIIN1ZHCCD6A",
|
||||
// Discv5.1
|
||||
"enr:-Ku4QOnVSyvzS3VbF87J8MubaRuTyfPi6B67XQg6-5eAV_uILAhn9geTTQmfqDIOcIeAxWHUUajQp6lYniAXPWncp6UBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpAYrkzLAAAAAf__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQKekYKqUtwbaJKKCct_srE5-g7tBUm68mj_jpeSb7CCqYN1ZHCCC7g",
|
||||
),
|
||||
Value: cli.NewStringSlice(params.BeaconNetworkConfig().BootstrapNodes...),
|
||||
}
|
||||
// RelayNode tells the beacon node which relay node to connect to.
|
||||
RelayNode = &cli.StringFlag{
|
||||
|
||||
@@ -36,18 +36,19 @@ type Flags struct {
|
||||
PyrmontTestnet bool // PyrmontTestnet defines the flag through which we can enable the node to run on the Pyrmont testnet.
|
||||
|
||||
// Feature related flags.
|
||||
WriteSSZStateTransitions bool // WriteSSZStateTransitions to tmp directory.
|
||||
SkipBLSVerify bool // Skips BLS verification across the runtime.
|
||||
EnableBlst bool // Enables new BLS library from supranational.
|
||||
PruneEpochBoundaryStates bool // PruneEpochBoundaryStates prunes the epoch boundary state before last finalized check point.
|
||||
EnableSnappyDBCompression bool // EnableSnappyDBCompression in the database.
|
||||
SlasherProtection bool // SlasherProtection protects validator fron sending over a slashable offense over the network using external slasher.
|
||||
EnableNoise bool // EnableNoise enables the beacon node to use NOISE instead of SECIO when performing a handshake with another peer.
|
||||
EnableEth1DataMajorityVote bool // EnableEth1DataMajorityVote uses the Voting With The Majority algorithm to vote for eth1data.
|
||||
EnablePeerScorer bool // EnablePeerScorer enables experimental peer scoring in p2p.
|
||||
EnablePruningDepositProofs bool // EnablePruningDepositProofs enables pruning deposit proofs which significantly reduces the size of a deposit
|
||||
EnableSyncBacktracking bool // EnableSyncBacktracking enables backtracking algorithm when searching for alternative forks during initial sync.
|
||||
EnableLargerGossipHistory bool // EnableLargerGossipHistory increases the gossip history we store in our caches.
|
||||
WriteSSZStateTransitions bool // WriteSSZStateTransitions to tmp directory.
|
||||
SkipBLSVerify bool // Skips BLS verification across the runtime.
|
||||
EnableBlst bool // Enables new BLS library from supranational.
|
||||
PruneEpochBoundaryStates bool // PruneEpochBoundaryStates prunes the epoch boundary state before last finalized check point.
|
||||
EnableSnappyDBCompression bool // EnableSnappyDBCompression in the database.
|
||||
SlasherProtection bool // SlasherProtection protects validator fron sending over a slashable offense over the network using external slasher.
|
||||
EnableNoise bool // EnableNoise enables the beacon node to use NOISE instead of SECIO when performing a handshake with another peer.
|
||||
EnableEth1DataMajorityVote bool // EnableEth1DataMajorityVote uses the Voting With The Majority algorithm to vote for eth1data.
|
||||
EnablePeerScorer bool // EnablePeerScorer enables experimental peer scoring in p2p.
|
||||
EnablePruningDepositProofs bool // EnablePruningDepositProofs enables pruning deposit proofs which significantly reduces the size of a deposit
|
||||
EnableSyncBacktracking bool // EnableSyncBacktracking enables backtracking algorithm when searching for alternative forks during initial sync.
|
||||
EnableLargerGossipHistory bool // EnableLargerGossipHistory increases the gossip history we store in our caches.
|
||||
WriteWalletPasswordOnWebOnboarding bool // WriteWalletPasswordOnWebOnboarding writes the password to disk after Prysm web signup.
|
||||
|
||||
// Logging related toggles.
|
||||
DisableGRPCConnectionLogs bool // Disables logging when a new grpc client has connected.
|
||||
@@ -206,6 +207,16 @@ func ConfigureValidator(ctx *cli.Context) {
|
||||
log.Warn("Enabled validator attestation and block slashing protection using an external slasher.")
|
||||
cfg.SlasherProtection = true
|
||||
}
|
||||
if ctx.Bool(writeWalletPasswordOnWebOnboarding.Name) {
|
||||
log.Warn("Enabled full web mode, wallet password will be written to disk at the wallet directory " +
|
||||
"upon completing web onboarding.")
|
||||
cfg.WriteWalletPasswordOnWebOnboarding = true
|
||||
}
|
||||
cfg.EnableBlst = true
|
||||
if ctx.Bool(disableBlst.Name) {
|
||||
log.Warn("Disabling new BLS library blst")
|
||||
cfg.EnableBlst = false
|
||||
}
|
||||
Init(cfg)
|
||||
}
|
||||
|
||||
|
||||
@@ -84,6 +84,11 @@ var (
|
||||
Name: "enable-larger-gossip-history",
|
||||
Usage: "Enables the node to store a larger amount of gossip messages in its cache.",
|
||||
}
|
||||
writeWalletPasswordOnWebOnboarding = &cli.BoolFlag{
|
||||
Name: "write-wallet-password-on-web-onboarding",
|
||||
Usage: "(Danger): Writes the wallet password to the wallet directory on completing Prysm web onboarding. " +
|
||||
"We recommend against this flag unless you are an advanced user.",
|
||||
}
|
||||
)
|
||||
|
||||
// devModeFlags holds list of flags that are set when development mode is on.
|
||||
@@ -94,6 +99,7 @@ var devModeFlags = []cli.Flag{
|
||||
|
||||
// ValidatorFlags contains a list of all the feature flags that apply to the validator client.
|
||||
var ValidatorFlags = append(deprecatedFlags, []cli.Flag{
|
||||
writeWalletPasswordOnWebOnboarding,
|
||||
enableExternalSlasherProtectionFlag,
|
||||
ToledoTestnet,
|
||||
PyrmontTestnet,
|
||||
|
||||
@@ -23,8 +23,5 @@ go_test(
|
||||
name = "go_default_test",
|
||||
srcs = ["stream_test.go"],
|
||||
embed = [":go_default_library"],
|
||||
deps = [
|
||||
"//shared/testutil/require:go_default_library",
|
||||
"@com_github_sirupsen_logrus//hooks/test:go_default_library",
|
||||
],
|
||||
deps = ["//shared/testutil/require:go_default_library"],
|
||||
)
|
||||
|
||||
@@ -3,7 +3,6 @@ package logutil
|
||||
import (
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
@@ -31,7 +30,7 @@ var (
|
||||
WriteBufferSize: 1024,
|
||||
CheckOrigin: func(r *http.Request) bool {
|
||||
// Only allow requests from localhost.
|
||||
return strings.Contains(r.Host, "localhost")
|
||||
return true
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
@@ -13,7 +13,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/shared/testutil/require"
|
||||
logTest "github.com/sirupsen/logrus/hooks/test"
|
||||
)
|
||||
|
||||
type fakeAddr int
|
||||
@@ -53,32 +52,6 @@ func (resp *testResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
|
||||
return fakeNetConn{strings.NewReader(""), resp.brw}, rw, nil
|
||||
}
|
||||
|
||||
func TestLogStreamServer_DisallowsNonLocalhostOrigin(t *testing.T) {
|
||||
hook := logTest.NewGlobal()
|
||||
ss := NewLogStreamServer()
|
||||
br := bufio.NewReader(strings.NewReader(""))
|
||||
buf := new(bytes.Buffer)
|
||||
bw := bufio.NewWriter(buf)
|
||||
rw := httptest.NewRecorder()
|
||||
resp := &testResponseWriter{
|
||||
brw: bufio.NewReadWriter(br, bw),
|
||||
ResponseWriter: rw,
|
||||
}
|
||||
req := &http.Request{
|
||||
Method: "GET",
|
||||
Host: "externalsource",
|
||||
Header: http.Header{
|
||||
"Upgrade": []string{"websocket"},
|
||||
"Connection": []string{"upgrade"},
|
||||
"Sec-Websocket-Key": []string{"dGhlIHNhbXBsZSBub25jZQ=="},
|
||||
"Sec-Websocket-Version": []string{"13"},
|
||||
},
|
||||
}
|
||||
ss.Handler(resp, req)
|
||||
require.NoError(t, resp.brw.Flush())
|
||||
require.LogsContain(t, hook, "origin not allowed")
|
||||
}
|
||||
|
||||
func TestLogStreamServer_BackfillsMessages(t *testing.T) {
|
||||
ss := NewLogStreamServer()
|
||||
msgs := [][]byte{
|
||||
|
||||
@@ -35,7 +35,23 @@ var mainnetNetworkConfig = &NetworkConfig{
|
||||
DepositContractAddress: "0x00000000219ab540356cBB839Cbe05303d7705Fa",
|
||||
ChainID: 1, // Chain ID of eth1 mainnet.
|
||||
NetworkID: 1, // Network ID of eth1 mainnet.
|
||||
BootstrapNodes: []string{},
|
||||
BootstrapNodes: []string{
|
||||
// Teku team's bootnode
|
||||
"enr:-KG4QOtcP9X1FbIMOe17QNMKqDxCpm14jcX5tiOE4_TyMrFqbmhPZHK_ZPG2Gxb1GE2xdtodOfx9-cgvNtxnRyHEmC0ghGV0aDKQ9aX9QgAAAAD__________4JpZIJ2NIJpcIQDE8KdiXNlY3AyNTZrMaEDhpehBDbZjM_L9ek699Y7vhUJ-eAdMyQW_Fil522Y0fODdGNwgiMog3VkcIIjKA",
|
||||
"enr:-KG4QDyytgmE4f7AnvW-ZaUOIi9i79qX4JwjRAiXBZCU65wOfBu-3Nb5I7b_Rmg3KCOcZM_C3y5pg7EBU5XGrcLTduQEhGV0aDKQ9aX9QgAAAAD__________4JpZIJ2NIJpcIQ2_DUbiXNlY3AyNTZrMaEDKnz_-ps3UUOfHWVYaskI5kWYO_vtYMGYCQRAR3gHDouDdGNwgiMog3VkcIIjKA",
|
||||
// Prylab team's bootnodes
|
||||
"enr:-Ku4QImhMc1z8yCiNJ1TyUxdcfNucje3BGwEHzodEZUan8PherEo4sF7pPHPSIB1NNuSg5fZy7qFsjmUKs2ea1Whi0EBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQOVphkDqal4QzPMksc5wnpuC3gvSC8AfbFOnZY_On34wIN1ZHCCIyg",
|
||||
"enr:-Ku4QP2xDnEtUXIjzJ_DhlCRN9SN99RYQPJL92TMlSv7U5C1YnYLjwOQHgZIUXw6c-BvRg2Yc2QsZxxoS_pPRVe0yK8Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY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e0dn8uYBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhBLY-NyJc2VjcDI1NmsxoQORcM6e19T1T9gi7jxEZjk_sjVLGFscUNqAY9obgZaxbIN1ZHCCIyg",
|
||||
"enr:-Ku4QPn5eVhcoF1opaFEvg1b6JNFD2rqVkHQ8HApOKK61OIcIXD127bKWgAtbwI7pnxx6cDyk_nI88TrZKQaGMZj0q0Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhDayLMaJc2VjcDI1NmsxoQK2sBOLGcUb4AwuYzFuAVCaNHA-dy24UuEKkeFNgCVCsIN1ZHCCIyg",
|
||||
"enr:-Ku4QEWzdnVtXc2Q0ZVigfCGggOVB2Vc1ZCPEc6j21NIFLODSJbvNaef1g4PxhPwl_3kax86YPheFUSLXPRs98vvYsoBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhDZBrP2Jc2VjcDI1NmsxoQM6jr8Rb1ktLEsVcKAPa08wCsKUmvoQ8khiOl_SLozf9IN1ZHCCIyg",
|
||||
},
|
||||
}
|
||||
|
||||
var mainnetBeaconConfig = &BeaconChainConfig{
|
||||
|
||||
@@ -40,7 +40,7 @@ func (s *SlotTicker) Done() {
|
||||
|
||||
// GetSlotTicker is the constructor for SlotTicker.
|
||||
func GetSlotTicker(genesisTime time.Time, secondsPerSlot uint64) *SlotTicker {
|
||||
if genesisTime.Unix() == 0 {
|
||||
if genesisTime.IsZero() {
|
||||
panic("zero genesis time")
|
||||
}
|
||||
ticker := &SlotTicker{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Hash Slinging Slasher Server Implementation
|
||||
# Slasher Implementation
|
||||
|
||||
This is the main project folder for a slasher server implementation for Ethereum Serenity in Golang by [Prysmatic Labs](https://prysmaticlabs.com). A slasher listens for all broadcasted messages using a running beacon node in order to detect slashable attestations and block proposals.
|
||||
This is the main project folder for a slasher implementation for eth2 written in Go by [Prysmatic Labs](https://prysmaticlabs.com). A slasher listens for all broadcasted messages using a running beacon node in order to detect slashable attestations and block proposals.
|
||||
It uses the [min-max-surround](https://github.com/protolambda/eth2-surround#min-max-surround) method by Protolambda.
|
||||
|
||||
The slasher requires a connection to a synced beacon node in order to listen for attestations and block proposals. To run the slasher, type:
|
||||
@@ -11,4 +11,4 @@ bazel run //slasher -- \
|
||||
--beacon-rpc-provider localhost:4000
|
||||
```
|
||||
|
||||
The beacon node entered in `beacon-rpc-provider` will then receive slashings from the slasher client and send them to any requesting proposer to be put into a block.
|
||||
The beacon node entered in `beacon-rpc-provider` will then receive slashings from the slasher client and send them to any requesting proposer to be put into a block. You can read more about configuration options for our slasher in our [documentation portal](https://docs.prylabs.network/docs/prysm-usage/slasher)
|
||||
|
||||
@@ -32,6 +32,35 @@ type Server struct {
|
||||
proposeLock sync.Mutex
|
||||
}
|
||||
|
||||
// HighestAttestations returns the highest observed attestation source and epoch for a given validator id.
|
||||
func (ss *Server) HighestAttestations(ctx context.Context, req *slashpb.HighestAttestationRequest) (*slashpb.HighestAttestationResponse, error) {
|
||||
ctx, span := trace.StartSpan(ctx, "history.HighestAttestations")
|
||||
defer span.End()
|
||||
|
||||
ret := make([]*slashpb.HighestAttestation, 0)
|
||||
for _, id := range req.ValidatorIds {
|
||||
if ctx.Err() != nil {
|
||||
return nil, ctx.Err()
|
||||
}
|
||||
|
||||
res, err := ss.slasherDB.HighestAttestation(ctx, id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if res != nil {
|
||||
ret = append(ret, &slashpb.HighestAttestation{
|
||||
ValidatorId: res.ValidatorId,
|
||||
HighestTargetEpoch: res.HighestTargetEpoch,
|
||||
HighestSourceEpoch: res.HighestSourceEpoch,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return &slashpb.HighestAttestationResponse{
|
||||
Attestations: ret,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// IsSlashableAttestation returns an attester slashing if the attestation submitted
|
||||
// is a slashable vote.
|
||||
func (ss *Server) IsSlashableAttestation(ctx context.Context, req *ethpb.IndexedAttestation) (*slashpb.AttesterSlashingResponse, error) {
|
||||
|
||||
55
third_party/README.md
vendored
55
third_party/README.md
vendored
@@ -59,58 +59,3 @@ go_repository(
|
||||
|
||||
Now, when used in Prysm, the dependency you patched will have the patched modifications
|
||||
when you run your code.
|
||||
|
||||
## Ethereum APIs Patch
|
||||
|
||||
As mentioned earlier, patches aren't a recommended approach when needing to modify dependencies
|
||||
in Prysm save for a few use cases. In particular, all of our public APIs and most canonical
|
||||
data structures for Prysm are kept in the [Ethereum APIs](https://github.com/prysmaticlabs/ethereumapis) repo.
|
||||
The purpose of the repo is to serve as a well-documented, well-maintained schema for a full-featured
|
||||
eth2 API. It is written in protobuf format, and specifies JSON over HTTP mappings as well
|
||||
as a [Swagger API](https://api.prylabs.network) front-end configuration.
|
||||
|
||||
The Prysm repo specifically requires its data structures to have certain struct tags
|
||||
for serialization purposes as well as other package-related annotations for proper functionality.
|
||||
Given a protobuf schema is meant to be generic, easily readable, accessible, and language agnostic
|
||||
(at least for languages which support protobuf generation), it would be wrong for us to include
|
||||
Go-specific annotations in the Ethereum APIs repo. Instead of maintaining a duplicate of it
|
||||
within Prysm, we can apply a patch to include those struct tags as needed, while being able
|
||||
to use the latest changes in the Ethereum APIs repo. This is an appropriate use-case for a patch.
|
||||
|
||||
Here's an example:
|
||||
|
||||
```
|
||||
// The block body of an Ethereum 2.0 beacon block.
|
||||
message BeaconBlockBody {
|
||||
// The validators RANDAO reveal 96 byte value.
|
||||
- bytes randao_reveal = 1;
|
||||
+ bytes randao_reveal = 1 [(gogoproto.moretags) = "ssz-size:\"96\""];
|
||||
|
||||
// A reference to the Ethereum 1.x chain.
|
||||
Eth1Data eth1_data = 2;
|
||||
|
||||
// 32 byte field of arbitrary data. This field may contain any data and
|
||||
// is not used for anything other than a fun message.
|
||||
- bytes graffiti = 3;
|
||||
+ bytes graffiti = 3 [(gogoproto.moretags) = "ssz-size:\"32\""];
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
Above, we're telling Prysm to patch a few lines to include protobuf tags
|
||||
for SSZ (the serialization library used by Prysm).
|
||||
|
||||
## Updating Patches
|
||||
|
||||
Say we want to update Ethereum APIs in Prysm to its latest master commit `b7452dde4ca361809def4ed5924ab3cb7ad1299a`.
|
||||
Here are the steps:
|
||||
|
||||
1. Go to your Prysm WORKSPACE and look at the commit in there for Ethereum APIs, say it's `e6f60041667fbc3edb22b03735ec111d1a40cd0e`
|
||||
2. Go to Ethereum APIs and do `git checkout e6f60041667fbc3edb22b03735ec111d1a40cd0e`
|
||||
3. In the Ethereum APIs repo, do `git apply $GOPATH/src/github.com/prysmaticlabs/prysm/third_party/com_github_prysmaticlabs_ethereumapis-tags.patch`
|
||||
4. Make any changes you want to make in Ethereum APIs, such as applying ssz struct tags, etc.
|
||||
5. In the Ethereum APIs repo, do `git commit -m "applied patch and changes"`
|
||||
6. Do `git merge master`
|
||||
7. Generate a new diff and update the diff in Prysm `git diff b7452dde4ca361809def4ed5924ab3cb7ad1299a > $GOPATH/src/github.com/prysmaticlabs/prysm/third_party/com_github_prysmaticlabs_ethereumapis-tags.patch`
|
||||
8. Update the commit in the Prysm WORKSPACE file for Ethereum APIs to `b7452dde4ca361809def4ed5924ab3cb7ad1299a`
|
||||
9. Build the Prysm project
|
||||
|
||||
@@ -66,9 +66,6 @@ type handler struct {
|
||||
}
|
||||
|
||||
func main() {
|
||||
// Using Medalla as the default configuration.
|
||||
params.UsePyrmontConfig()
|
||||
|
||||
flag.Parse()
|
||||
|
||||
if *logFileName != "" {
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
load("@prysm//tools/go:def.bzl", "go_library")
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_binary")
|
||||
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
|
||||
load("@io_bazel_rules_docker//container:container.bzl", "container_bundle")
|
||||
load("@io_bazel_rules_docker//contrib:push-all.bzl", "docker_push")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["main.go"],
|
||||
importpath = "github.com/prysmaticlabs/prysm/tools/contract-addr",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = ["//shared/maxprocs:go_default_library"],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "contract-addr",
|
||||
embed = [":go_default_library"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
go_image(
|
||||
name = "image",
|
||||
base = "//tools:go_image",
|
||||
binary = ":contract-addr",
|
||||
tags = ["manual"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
container_bundle(
|
||||
name = "image_bundle",
|
||||
images = {
|
||||
"gcr.io/prysmaticlabs/prysm/contract-addr:latest": ":image",
|
||||
"gcr.io/prysmaticlabs/prysm/contract-addr:{DOCKER_TAG}": ":image",
|
||||
},
|
||||
tags = ["manual"],
|
||||
)
|
||||
|
||||
docker_push(
|
||||
name = "push_images",
|
||||
bundle = ":image_bundle",
|
||||
tags = ["manual"],
|
||||
)
|
||||
@@ -1,44 +0,0 @@
|
||||
/**
|
||||
* This tool exists to serve currently configured contract address in k8s.
|
||||
* It reads the contract address from a plain text file as provided by etcd.
|
||||
*/
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
_ "github.com/prysmaticlabs/prysm/shared/maxprocs"
|
||||
)
|
||||
|
||||
var address = flag.String("address-path", "", "The file path to the plain text file with the contract address")
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
if *address == "" {
|
||||
panic("Contract address filepath not set")
|
||||
}
|
||||
|
||||
fmt.Println("Starting on port 8080")
|
||||
log.Fatal(http.ListenAndServe(":8080", &handler{}))
|
||||
|
||||
}
|
||||
|
||||
type handler struct{}
|
||||
|
||||
func (h *handler) ServeHTTP(w http.ResponseWriter, _ *http.Request) {
|
||||
dat, err := ioutil.ReadFile(*address)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
_, err = io.WriteString(w, string(dat))
|
||||
if err != nil {
|
||||
fmt.Printf("Failed to write response: %v", err)
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
load("@prysm//tools/go:def.bzl", "go_library")
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_binary")
|
||||
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
|
||||
load("@io_bazel_rules_docker//container:container.bzl", "container_bundle")
|
||||
load("@io_bazel_rules_docker//contrib:push-all.bzl", "docker_push")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["relaynode.go"],
|
||||
importpath = "github.com/prysmaticlabs/prysm/tools/relaynode",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//shared/maxprocs:go_default_library",
|
||||
"//shared/version:go_default_library",
|
||||
"@com_github_ipfs_go_log//:go_default_library",
|
||||
"@com_github_libp2p_go_libp2p//:go_default_library",
|
||||
"@com_github_libp2p_go_libp2p_circuit//:go_default_library",
|
||||
"@com_github_libp2p_go_libp2p_crypto//:go_default_library",
|
||||
"@com_github_multiformats_go_multiaddr//:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
go_image(
|
||||
name = "image",
|
||||
base = "//tools:go_image",
|
||||
binary = ":relaynode",
|
||||
tags = ["manual"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "relaynode",
|
||||
embed = [":go_default_library"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
container_bundle(
|
||||
name = "image_bundle",
|
||||
images = {
|
||||
"gcr.io/prysmaticlabs/prysm/relaynode:latest": ":image",
|
||||
"gcr.io/prysmaticlabs/prysm/relaynode:{DOCKER_TAG}": ":image",
|
||||
},
|
||||
tags = ["manual"],
|
||||
)
|
||||
|
||||
docker_push(
|
||||
name = "push_images",
|
||||
bundle = ":image_bundle",
|
||||
tags = ["manual"],
|
||||
)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user