Skip to content

Commit

Permalink
Moving latest development work back into eip-4844 branch (#39)
Browse files Browse the repository at this point in the history
* update to use latest kzg lib (#35)

* Expose JSON GetBlock

* start port over to the shared kzg lib (#37)

* start port over to the shared kzg lib

* have CL compute the aggregated proof for the block, per updated spec

* start port over to the shared kzg lib (#37) (#38)

* start port over to the shared kzg lib

* have CL compute the aggregated proof for the block, per updated spec

Co-authored-by: dancoffman <coffman@coinbase.com>
Co-authored-by: Daniel Coffman <dgcoffman@gmail.com>
  • Loading branch information
3 people authored Nov 16, 2022
1 parent eb1b85d commit 11dda37
Show file tree
Hide file tree
Showing 21 changed files with 150 additions and 671 deletions.
196 changes: 0 additions & 196 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -396,216 +396,20 @@ go_repository(
version = "v0.14.0",
)

go_repository(
name = "com_github_confluentinc_confluent_kafka_go",
importpath = "github.com/confluentinc/confluent-kafka-go",
sum = "h1:13EK9RTujF7lVkvHQ5Hbu6bM+Yfrq8L0MkJNnjHSd4Q=",
version = "v1.4.2",
)

go_repository(
name = "com_github_dnaeon_go_vcr",
importpath = "github.com/dnaeon/go-vcr",
sum = "h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI=",
version = "v1.2.0",
)

go_repository(
name = "com_github_form3tech_oss_jwt_go",
importpath = "github.com/form3tech-oss/jwt-go",
sum = "h1:xdtqez379uWVJ9P3qQMX8W+F/nqsTdUvyMZB36tnacA=",
version = "v3.2.1+incompatible",
)

go_repository(
name = "com_github_go_check_check",
importpath = "github.com/go-check/check",
sum = "h1:0gkP6mzaMqkmpcJYCFOLkIBwI7xFExG03bbkOkCvUPI=",
version = "v0.0.0-20180628173108-788fd7840127",
)

go_repository(
name = "com_github_iancoleman_strcase",
importpath = "github.com/iancoleman/strcase",
sum = "h1:dJBk1m2/qjL1twPLf68JND55vvivMupZ4wIzE8CTdBw=",
version = "v0.1.3",
)

go_repository(
name = "com_github_ipfs_go_ipfs_addr",
importpath = "github.com/ipfs/go-ipfs-addr",
sum = "h1:DpDFybnho9v3/a1dzJ5KnWdThWD1HrFLpQ+tWIyBaFI=",
version = "v0.0.1",
)

go_repository(
name = "com_github_jackpal_gateway",
importpath = "github.com/jackpal/gateway",
sum = "h1:qzXWUJfuMdlLMtt0a3Dgt+xkWQiA5itDEITVJtuSwMc=",
version = "v1.0.5",
)

go_repository(
name = "com_github_kubuxu_go_os_helper",
importpath = "github.com/Kubuxu/go-os-helper",
sum = "h1:EJiD2VUQyh5A9hWJLmc6iWg6yIcJ7jpBcwC8GMGXfDk=",
version = "v0.0.1",
)

go_repository(
name = "com_github_libp2p_go_addr_util",
importpath = "github.com/libp2p/go-addr-util",
sum = "h1:7cWK5cdA5x72jX0g8iLrQWm5TRJZ6CzGdPEhWj7plWU=",
version = "v0.0.2",
)

go_repository(
name = "com_github_libp2p_go_libp2p_autonat",
importpath = "github.com/libp2p/go-libp2p-autonat",
sum = "h1:3y8XQbpr+ssX8QfZUHekjHCYK64sj6/4hnf/awD4+Ug=",
version = "v0.4.0",
)

go_repository(
name = "com_github_libp2p_go_libp2p_crypto",
importpath = "github.com/libp2p/go-libp2p-crypto",
sum = "h1:k9MFy+o2zGDNGsaoZl0MA3iZ75qXxr9OOoAZF+sD5OQ=",
version = "v0.1.0",
)

go_repository(
name = "com_github_libp2p_go_libp2p_discovery",
importpath = "github.com/libp2p/go-libp2p-discovery",
sum = "h1:Qfl+e5+lfDgwdrXdu4YNCWyEo3fWuP+WgN9mN0iWviQ=",
version = "v0.5.0",
)

go_repository(
name = "com_github_libp2p_go_libp2p_loggables",
importpath = "github.com/libp2p/go-libp2p-loggables",
sum = "h1:h3w8QFfCt2UJl/0/NW4K829HX/0S4KD31PQ7m8UXXO8=",
version = "v0.1.0",
)

go_repository(
name = "com_github_libp2p_go_libp2p_nat",
importpath = "github.com/libp2p/go-libp2p-nat",
sum = "h1:wMWis3kYynCbHoyKLPBEMu4YRLltbm8Mk08HGSfvTkU=",
version = "v0.0.6",
)

go_repository(
name = "com_github_libp2p_go_libp2p_netutil",
importpath = "github.com/libp2p/go-libp2p-netutil",
sum = "h1:zscYDNVEcGxyUpMd0JReUZTrpMfia8PmLKcKF72EAMQ=",
version = "v0.1.0",
)

go_repository(
name = "com_github_libp2p_go_libp2p_noise",
importpath = "github.com/libp2p/go-libp2p-noise",
sum = "h1:IH9GRihQJTx56obm+GnpdPX4KeVIlvpXrP6xnJ0wxWk=",
version = "v0.1.2",
)

go_repository(
name = "com_github_libp2p_go_libp2p_peer",
importpath = "github.com/libp2p/go-libp2p-peer",
sum = "h1:EQ8kMjaCUwt/Y5uLgjT8iY2qg0mGUT0N1zUjer50DsY=",
version = "v0.2.0",
)

go_repository(
name = "com_github_libp2p_go_libp2p_secio",
importpath = "github.com/libp2p/go-libp2p-secio",
sum = "h1:rLLPvShPQAcY6eNurKNZq3eZjPWfU9kXF2eI9jIYdrg=",
version = "v0.2.2",
)

go_repository(
name = "com_github_libp2p_go_stream_muxer",
importpath = "github.com/libp2p/go-stream-muxer",
sum = "h1:Ce6e2Pyu+b5MC1k3eeFtAax0pW4gc6MosYSLV05UeLw=",
version = "v0.0.1",
)

go_repository(
name = "com_github_libp2p_go_ws_transport",
importpath = "github.com/libp2p/go-ws-transport",
sum = "h1:ZX5rWB8nhRRJVaPO6tmkGI/Xx8XNboYX20PW5hXIscw=",
version = "v0.3.1",
)

go_repository(
name = "com_github_libp2p_go_yamux",
importpath = "github.com/libp2p/go-yamux",
sum = "h1:P1Fe9vF4th5JOxxgQvfbOHkrGqIZniTLf+ddhZp8YTI=",
version = "v1.4.1",
)

go_repository(
name = "com_github_modocache_gover",
importpath = "github.com/modocache/gover",
sum = "h1:8Q0qkMVC/MmWkpIdlvZgcv2o2jrlF6zqVOh7W5YHdMA=",
version = "v0.0.0-20171022184752-b58185e213c5",
)

go_repository(
name = "com_github_nbutton23_zxcvbn_go",
importpath = "github.com/nbutton23/zxcvbn-go",
sum = "h1:AREM5mwr4u1ORQBMvzfzBgpsctsbQikCVpvC+tX285E=",
version = "v0.0.0-20180912185939-ae427f1e4c1d",
)

go_repository(
name = "com_github_prestonvanloon_go_recaptcha",
importpath = "github.com/prestonvanloon/go-recaptcha",
sum = "h1:/JK1WfWJGBNDKY70uiB53iKKbFqxBx2CuYgj9hK2O70=",
version = "v0.0.0-20190217191114-0834cef6e8bd",
)

go_repository(
name = "com_github_prysmaticlabs_eth2_types",
importpath = "github.com/prysmaticlabs/eth2-types",
sum = "h1:1dN7YAqMN3oAJ0LceWcyv/U4jHLh+5urnSnr4br6zg4=",
version = "v0.0.0-20210303084904-c9735a06829d",
)

go_repository(
name = "com_github_prysmaticlabs_prysm",
importpath = "github.com/prysmaticlabs/prysm",
sum = "h1:vgtnaMaTpKHPRcFNbndLH+qf5NWNMykTmnCHFDvH/4o=",
version = "v1.4.4",
)

go_repository(
name = "com_github_whyrusleeping_go_keyspace",
importpath = "github.com/whyrusleeping/go-keyspace",
sum = "h1:EKhdznlJHPMoKr0XTrX+IlJs1LH3lyx2nfr1dOlZ79k=",
version = "v0.0.0-20160322163242-5b898ac5add1",
)

go_repository(
name = "com_github_whyrusleeping_go_logging",
importpath = "github.com/whyrusleeping/go-logging",
sum = "h1:fwpzlmT0kRC/Fmd0MdmGgJG/CXIZ6gFq46FQZjprUcc=",
version = "v0.0.1",
)

go_repository(
name = "com_github_whyrusleeping_mafmt",
importpath = "github.com/whyrusleeping/mafmt",
sum = "h1:TCghSl5kkwEE0j+sU/gudyhVMRlpBin8fMBBHg59EbA=",
version = "v1.2.8",
)

go_repository(
name = "in_gopkg_confluentinc_confluent_kafka_go_v1",
importpath = "gopkg.in/confluentinc/confluent-kafka-go.v1",
sum = "h1:JabkIV98VYFqYKHHzXtgGMFuRgFBNTNzBytbGByzrJI=",
version = "v1.4.2",
)

gazelle_dependencies()

load("@com_github_bazelbuild_buildtools//buildifier:deps.bzl", "buildifier_dependencies")
Expand Down
15 changes: 15 additions & 0 deletions api/client/beacon/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ func withSSZEncoding() reqOption {
}
}

func withJSONEncoding() reqOption {
return func(req *http.Request) {
req.Header.Set("Accept", "application/json")
}
}

// get is a generic, opinionated GET function to reduce boilerplate amongst the getters in this package.
func (c *Client) get(ctx context.Context, path string, opts ...reqOption) ([]byte, error) {
u := c.baseURL.ResolveReference(&url.URL{Path: path})
Expand Down Expand Up @@ -189,6 +195,15 @@ func (c *Client) GetBlock(ctx context.Context, blockId StateOrBlockId) ([]byte,
return b, nil
}

func (c *Client) GetBlockJSON(ctx context.Context, blockId StateOrBlockId) ([]byte, error) {
blockPath := renderGetBlockPath(blockId)
b, err := c.get(ctx, blockPath, withJSONEncoding())
if err != nil {
return nil, errors.Wrapf(err, "error requesting state by id = %s", blockId)
}
return b, nil
}

var getBlockRootTpl = idTemplate(getBlockRootPath)

// GetBlockRoot retrieves the hash_tree_root of the BeaconBlock for the given block id.
Expand Down
2 changes: 0 additions & 2 deletions beacon-chain/core/blob/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@ go_library(
"@com_github_ethereum_go_ethereum//crypto/kzg:go_default_library",
"@com_github_ethereum_go_ethereum//params:go_default_library",
"@com_github_pkg_errors//:go_default_library",
"@com_github_protolambda_go_kzg//bls:go_default_library",
"@com_github_prysmaticlabs_fastssz//:go_default_library",
],
)
Loading

0 comments on commit 11dda37

Please sign in to comment.