Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Final Missing Items in Block Processing v0.6 #2710

Merged
merged 33 commits into from
Jun 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a549b39
override config successfully
rauljordan May 22, 2019
efa31a9
Merge branch 'spec-v0.6' into tidy-up-block-processing-v0.6
rauljordan May 27, 2019
6262908
resolve confs with v0.6
rauljordan Jun 2, 2019
91c9bc5
passes processing
rauljordan Jun 2, 2019
15436b7
add signing root helper
rauljordan Jun 2, 2019
fcdf23e
blockchain tests pass
rauljordan Jun 2, 2019
4e6b437
tests blocked by signing root
rauljordan Jun 2, 2019
2acb95b
Merge branch 'spec-v0.6' of https://github.com/prysmaticlabs/geth-sha…
nisdas Jun 11, 2019
f29d041
lint
nisdas Jun 11, 2019
9fd8ffa
fix references
nisdas Jun 11, 2019
381a6a8
fix protos
nisdas Jun 11, 2019
bbc77ee
proper use of signing root
rauljordan Jun 11, 2019
d75a36f
only few failing tests now
rauljordan Jun 11, 2019
63fc5cb
fix final test
rauljordan Jun 11, 2019
3cb5050
fix conflicts
rauljordan Jun 11, 2019
d8c4c11
tests passing
rauljordan Jun 11, 2019
fd49842
lint and imports
rauljordan Jun 11, 2019
50f6bff
rem unused
rauljordan Jun 11, 2019
27d8dd2
Update beacon-chain/core/blocks/block_operations.go
rauljordan Jun 11, 2019
500b950
lint
rauljordan Jun 11, 2019
6a5038a
Merge branch 'tidy-up-block-processing-v0.6' of github.com:prysmaticl…
rauljordan Jun 11, 2019
0752aef
Update beacon-chain/attestation/service_test.go
rauljordan Jun 17, 2019
343897a
Update beacon-chain/db/block_test.go
rauljordan Jun 17, 2019
21d3c22
fmt and tidy up
rauljordan Jun 17, 2019
9ce2971
Merge branch 'tidy-up-block-processing-v0.6' of github.com:prysmaticl…
rauljordan Jun 17, 2019
5bfb4b3
rename to hash tree root
rauljordan Jun 17, 2019
145c8a8
rename decode to unmarshal
rauljordan Jun 17, 2019
cd44ee4
fix
rauljordan Jun 17, 2019
f09003d
use latest ssz
rauljordan Jun 17, 2019
92c15be
all tests passing
rauljordan Jun 17, 2019
cb5efe7
lint
rauljordan Jun 17, 2019
76133c5
Merge branch 'spec-v0.6' into tidy-up-block-processing-v0.6
rauljordan Jun 18, 2019
eedb444
fmt
rauljordan Jun 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,6 @@ load("@com_github_bazelbuild_buildtools//buildifier:deps.bzl", "buildifier_depen

buildifier_dependencies()

http_archive(
name = "com_github_prysmaticlabs_go_ssz",
sha256 = "352d7e12788bbd1126bfeb3817a75f94c9d1f8697348103a2a070442efa0f608",
strip_prefix = "go-ssz-f4c769c5c2f666c0a2db5acaf327da6e74f2100d",
url = "https://github.com/prysmaticlabs/go-ssz/archive/f4c769c5c2f666c0a2db5acaf327da6e74f2100d.tar.gz",
)

load("@com_github_prysmaticlabs_go_ssz//:deps.bzl", "go_ssz_dependencies")

go_ssz_dependencies()

go_repository(
name = "com_github_golang_mock",
commit = "51421b967af1f557f93a59e0057aaf15ca02e29c", # v1.2.0
Expand All @@ -171,6 +160,16 @@ go_repository(
vcs = "git",
)

go_repository(
name = "com_github_prysmaticlabs_go_ssz",
commit = "be5e1bd95e5c389a672eec5b57831441a160a0b7",
importpath = "github.com/prysmaticlabs/go-ssz",
)

load("@com_github_prysmaticlabs_go_ssz//:deps.bzl", "go_ssz_dependencies")

go_ssz_dependencies()

go_repository(
name = "com_github_urfave_cli",
commit = "cfb38830724cc34fedffe9a2a29fb54fa9169cd1", # v1.20.0
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/attestation/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ go_test(
deps = [
"//beacon-chain/internal:go_default_library",
"//proto/beacon/p2p/v1:go_default_library",
"//shared/blockutil:go_default_library",
"//shared/bytesutil:go_default_library",
"//shared/hashutil:go_default_library",
"//shared/params:go_default_library",
"//shared/testutil:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
Expand Down
4 changes: 2 additions & 2 deletions beacon-chain/attestation/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/prysmaticlabs/prysm/beacon-chain/internal"
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
"github.com/prysmaticlabs/prysm/shared/blockutil"
"github.com/prysmaticlabs/prysm/shared/bytesutil"
"github.com/prysmaticlabs/prysm/shared/hashutil"
"github.com/prysmaticlabs/prysm/shared/params"
"github.com/prysmaticlabs/prysm/shared/testutil"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -175,7 +175,7 @@ func TestLatestAttestationTarget_ReturnsLatestAttestedBlock(t *testing.T) {
if err := beaconDB.SaveBlock(block); err != nil {
t.Fatalf("could not save block: %v", err)
}
blockRoot, err := hashutil.HashBeaconBlock(block)
blockRoot, err := blockutil.BlockSigningRoot(block)
if err != nil {
log.Fatalf("could not hash block: %v", err)
}
Expand Down
2 changes: 2 additions & 0 deletions beacon-chain/blockchain/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ go_library(
"//beacon-chain/operations:go_default_library",
"//beacon-chain/powchain:go_default_library",
"//proto/beacon/p2p/v1:go_default_library",
"//shared/blockutil:go_default_library",
"//shared/bytesutil:go_default_library",
"//shared/event:go_default_library",
"//shared/featureconfig:go_default_library",
Expand Down Expand Up @@ -53,6 +54,7 @@ go_test(
"//beacon-chain/internal:go_default_library",
"//beacon-chain/powchain:go_default_library",
"//proto/beacon/p2p/v1:go_default_library",
"//shared/blockutil:go_default_library",
"//shared/bls:go_default_library",
"//shared/bytesutil:go_default_library",
"//shared/event:go_default_library",
Expand Down
7 changes: 4 additions & 3 deletions beacon-chain/blockchain/block_processing.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/prysmaticlabs/prysm/beacon-chain/core/state"
"github.com/prysmaticlabs/prysm/beacon-chain/core/validators"
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
"github.com/prysmaticlabs/prysm/shared/blockutil"
"github.com/prysmaticlabs/prysm/shared/bytesutil"
"github.com/prysmaticlabs/prysm/shared/event"
"github.com/prysmaticlabs/prysm/shared/featureconfig"
Expand Down Expand Up @@ -70,7 +71,7 @@ func (c *ChainService) ReceiveBlock(ctx context.Context, block *pb.BeaconBlock)
return nil, fmt.Errorf("could not retrieve beacon state: %v", err)
}

blockRoot, err := hashutil.HashBeaconBlock(block)
blockRoot, err := blockutil.BlockSigningRoot(block)
Copy link
Member

Choose a reason for hiding this comment

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

this may be out of scope for this PR,
I wonder if SigningRoot belongs in blockutil because it's more generalized that just block. We use SigningRoot for transfer, slashing and deposit objects as well

I think putting it inhashutil and renaming to SigningRoot are better

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, but like you said for another PR.

if err != nil {
return nil, fmt.Errorf("could not hash beacon block")
}
Expand Down Expand Up @@ -159,7 +160,7 @@ func (c *ChainService) VerifyBlockValidity(
// peers via p2p. Blocks which have already been saved are not processed again via p2p, which is why
// the order of operations is important in this function to prevent infinite p2p loops.
func (c *ChainService) SaveAndBroadcastBlock(ctx context.Context, block *pb.BeaconBlock) error {
blockRoot, err := hashutil.HashBeaconBlock(block)
blockRoot, err := blockutil.BlockSigningRoot(block)
if err != nil {
return fmt.Errorf("could not tree hash incoming block: %v", err)
}
Expand Down Expand Up @@ -238,7 +239,7 @@ func (c *ChainService) AdvanceState(
"slotsSinceGenesis", newState.Slot,
).Info("Block transition successfully processed")

blockRoot, err := hashutil.HashBeaconBlock(block)
blockRoot, err := blockutil.BlockSigningRoot(block)
if err != nil {
return nil, err
}
Expand Down
Loading