Skip to content

Commit

Permalink
feat: everything needed for genesis
Browse files Browse the repository at this point in the history
  • Loading branch information
joroshiba committed Jan 17, 2024
1 parent 75206fb commit d6df03e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 21 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/ethereum/go-ethereum
go 1.21

require (
buf.build/gen/go/astria/astria/grpc/go v1.3.0-20231213194648-0685137780d3.2
buf.build/gen/go/astria/astria/protocolbuffers/go v1.31.0-20231213194648-0685137780d3.2
buf.build/gen/go/astria/astria/grpc/go v1.3.0-20240116222638-a448c1fa8d5a.2
buf.build/gen/go/astria/astria/protocolbuffers/go v1.32.0-20240116222638-a448c1fa8d5a.1
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0
github.com/Microsoft/go-winio v0.6.1
github.com/VictoriaMetrics/fastcache v1.12.1
Expand Down Expand Up @@ -73,7 +73,7 @@ require (
golang.org/x/time v0.3.0
golang.org/x/tools v0.13.0
google.golang.org/grpc v1.53.0
google.golang.org/protobuf v1.31.0
google.golang.org/protobuf v1.32.0
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/yaml.v3 v3.0.1
)
Expand Down
30 changes: 15 additions & 15 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
buf.build/gen/go/astria/astria/grpc/go v1.3.0-20231213194648-0685137780d3.2 h1:BjTKxda1u3xdJXS1LYA5R0OfT46bZp5ji+1yg7/JQHQ=
buf.build/gen/go/astria/astria/grpc/go v1.3.0-20231213194648-0685137780d3.2/go.mod h1:sDLOOS2EuERVuqV4+gpqjYjq65+Ebb+SIt5Dxics7wQ=
buf.build/gen/go/astria/astria/protocolbuffers/go v1.28.1-20231213194648-0685137780d3.4/go.mod h1:a2nDGgMECtFWAbBm06prW70xA/jP8X44wz9jpii2cxo=
buf.build/gen/go/astria/astria/protocolbuffers/go v1.31.0-20231213194648-0685137780d3.2 h1:F4Ogo0F7A19d90esHhjYuPVrvQejwLkIMLpDDDYlDrk=
buf.build/gen/go/astria/astria/protocolbuffers/go v1.31.0-20231213194648-0685137780d3.2/go.mod h1:OPKBvxqrsHTBen+bbkQT/beHK/aSznSulzR+JeDSUKw=
buf.build/gen/go/astria/astria/grpc/go v1.3.0-20240116222638-a448c1fa8d5a.2 h1:S7DdHhTg/v+BHEU4WaTnBCReGB2YFr7H8A7fgjkMZC8=
buf.build/gen/go/astria/astria/grpc/go v1.3.0-20240116222638-a448c1fa8d5a.2/go.mod h1:E6uL+i0HBdhnF5z72VdlRAMvuPgugl+PFF1f60Lkoso=
buf.build/gen/go/astria/astria/protocolbuffers/go v1.28.1-20240116222638-a448c1fa8d5a.4/go.mod h1:a2nDGgMECtFWAbBm06prW70xA/jP8X44wz9jpii2cxo=
buf.build/gen/go/astria/astria/protocolbuffers/go v1.32.0-20240116222638-a448c1fa8d5a.1 h1:U2M7lyl3CllQnr1NwF4Mrb8MlCRYWP8nr0Fid7y1kz8=
buf.build/gen/go/astria/astria/protocolbuffers/go v1.32.0-20240116222638-a448c1fa8d5a.1/go.mod h1:HTIae3hIWhV69v7f8BJQzr2tP6yd0/gxwLrMiG306RY=
buf.build/gen/go/cosmos/cosmos-proto/grpc/go v1.3.0-20211202220400-1935555c206d.2/go.mod h1:AS+jUupCTrSz+T88+ZsW4cOQwkYftIjjMzqXoK0hp3k=
buf.build/gen/go/cosmos/cosmos-proto/protocolbuffers/go v1.28.1-20211202220400-1935555c206d.4/go.mod h1:eLpHyQeVRAtShjbHVpIla0w/42RZAdaaTpBErMv/6sc=
buf.build/gen/go/cosmos/cosmos-proto/protocolbuffers/go v1.31.0-20211202220400-1935555c206d.2/go.mod h1:yHKMbegvhfMbDGsQp/q7tECJTfZf0wrgTRcH1glgEQk=
buf.build/gen/go/cosmos/cosmos-proto/protocolbuffers/go v1.32.0-20211202220400-1935555c206d.1/go.mod h1:GpU2rx3tDDSvCER8/rvvgu6s6LeMU73TKjfBZ89OZKg=
buf.build/gen/go/cosmos/cosmos-sdk/grpc/go v1.3.0-20230522115704-e7a85cef453e.2/go.mod h1:cZOEXwhGC2HYgN4DJvbdZNEWGnghUlN7ZwkyJKKqw/g=
buf.build/gen/go/cosmos/cosmos-sdk/grpc/go v1.3.0-20230719110346-aa25660f4ff7.2/go.mod h1:u82E8x7rLqs3igb0i4Ul1fFwx384I7oJnmn4FmclOTw=
buf.build/gen/go/cosmos/cosmos-sdk/protocolbuffers/go v1.28.1-20230522115704-e7a85cef453e.4/go.mod h1:WwWRz97saFM8fwl9UcqhFzQOvN+8QkZwa4AAL37pqaA=
buf.build/gen/go/cosmos/cosmos-sdk/protocolbuffers/go v1.28.1-20230719110346-aa25660f4ff7.4/go.mod h1:RFHPh4mUMobZH69MX2BCwzRVG+JNUfAp9J2fIiYylcA=
buf.build/gen/go/cosmos/cosmos-sdk/protocolbuffers/go v1.31.0-20230522115704-e7a85cef453e.2/go.mod h1:d16Ahcn3H831Oe+NnNOWuXkV3aTiPOBZvUAZaHYECkU=
buf.build/gen/go/cosmos/cosmos-sdk/protocolbuffers/go v1.31.0-20230719110346-aa25660f4ff7.2/go.mod h1:vg3BLbBJ3Vl9Wu7GE6BmxYq1+VMU4Yg8cv9YG7qF2AQ=
buf.build/gen/go/cosmos/cosmos-sdk/protocolbuffers/go v1.32.0-20230522115704-e7a85cef453e.1/go.mod h1:J8VpbpzO6pccEOWdLbYylDP8lRPifk2EA8tmJNkdZZo=
buf.build/gen/go/cosmos/cosmos-sdk/protocolbuffers/go v1.32.0-20230719110346-aa25660f4ff7.1/go.mod h1:Tl9HTTTqDT4kfcsEwfEyUeFdJmbcgSOXL2q50rG5XBw=
buf.build/gen/go/cosmos/gogo-proto/grpc/go v1.3.0-20221020125208-34d970b699f8.2/go.mod h1:PKPJRNiORF0FABGYEXbc1iTG+rzNA/4JUfDGkaFPskA=
buf.build/gen/go/cosmos/gogo-proto/grpc/go v1.3.0-20230509103710-5e5b9fdd0180.2/go.mod h1:VLlOf39tq7bgN9oEwG9ElFuzSHlDRrlp6be0GQW9oCw=
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.28.1-20221020125208-34d970b699f8.4/go.mod h1:yABYnsmLNsRsuOb4SD5Xr511HUTzjhrc5KD1nFHIiNs=
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.28.1-20230509103710-5e5b9fdd0180.4/go.mod h1:yABYnsmLNsRsuOb4SD5Xr511HUTzjhrc5KD1nFHIiNs=
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.31.0-20221020125208-34d970b699f8.2/go.mod h1:rTzewyj2LANV2IIuGZnKMsvbIEVAguDwBvMdxD1pa3k=
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.31.0-20230509103710-5e5b9fdd0180.2/go.mod h1:rTzewyj2LANV2IIuGZnKMsvbIEVAguDwBvMdxD1pa3k=
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.32.0-20221020125208-34d970b699f8.1/go.mod h1:5GqIYthcy/ASmnKcaT26APpxMhZirnIHXHKki69zjWI=
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.32.0-20230509103710-5e5b9fdd0180.1/go.mod h1:5GqIYthcy/ASmnKcaT26APpxMhZirnIHXHKki69zjWI=
buf.build/gen/go/cosmos/ibc/grpc/go v1.3.0-20230913112312-7ab44ae956a0.2/go.mod h1:BO30VkuVfhMtQHD6CSpVR2Q646XCJuwlrTp/OkgJxYg=
buf.build/gen/go/cosmos/ibc/protocolbuffers/go v1.28.1-20230913112312-7ab44ae956a0.4/go.mod h1:0kwZox/T/DuD4YiSHSn76mEPEFraCnaWwdkuhHrcr/s=
buf.build/gen/go/cosmos/ibc/protocolbuffers/go v1.31.0-20230913112312-7ab44ae956a0.2/go.mod h1:piKWSxT4f990Ium90hWQnNwuqxhsoYxhPtZYcOz2vNs=
buf.build/gen/go/cosmos/ibc/protocolbuffers/go v1.32.0-20230913112312-7ab44ae956a0.1/go.mod h1:IPgm3IicGPCXFRfFMLOgHFp3kexNEULuIzEJshSNPcY=
buf.build/gen/go/cosmos/ics23/grpc/go v1.3.0-20221207100654-55085f7c710a.2/go.mod h1:gUin8BTHrs/dRa0bdSHBb0twUODf4pUk4R9tPhOsPmc=
buf.build/gen/go/cosmos/ics23/protocolbuffers/go v1.28.1-20221207100654-55085f7c710a.4/go.mod h1:bASIBnznZv/r+XmEKQvGR5+1D+VkRjQG3K0mtlNL4l0=
buf.build/gen/go/cosmos/ics23/protocolbuffers/go v1.31.0-20221207100654-55085f7c710a.2/go.mod h1:1V7tFOxP2P2x8G0oasO+VqSHN0Bhly5I/e+2vENGomQ=
buf.build/gen/go/cosmos/ics23/protocolbuffers/go v1.32.0-20221207100654-55085f7c710a.1/go.mod h1:pjXPxEgmuc0apOM+/10DC/vWa3di1I0Z+CxwKqRXWYQ=
buf.build/gen/go/penumbra-zone/penumbra/grpc/go v1.3.0-20231120132728-bc443669626d.2/go.mod h1:f02cXVjnFw1swHvdrTWUfuH29d4UEl7mgVUg581vtXU=
buf.build/gen/go/penumbra-zone/penumbra/protocolbuffers/go v1.28.1-20231120132728-bc443669626d.4/go.mod h1:mbqAF6Y8Bzzf8D+vY21ktscpxes7AusdpvIW/slzsdI=
buf.build/gen/go/penumbra-zone/penumbra/protocolbuffers/go v1.31.0-20231120132728-bc443669626d.2/go.mod h1:h82VMeit0Ae3VmGvS6QH6yJx9GPHM3y4y0x1JU3Vyyc=
buf.build/gen/go/penumbra-zone/penumbra/protocolbuffers/go v1.32.0-20231120132728-bc443669626d.1/go.mod h1:HOI8VDE0aOk+R3EtXPICCUm0pO8D0PSnS7k2fFq2soE=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
Expand Down Expand Up @@ -1679,8 +1679,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
17 changes: 17 additions & 0 deletions grpc/execution/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package execution

import (
"context"
"crypto/sha256"
"fmt"
"sync"
"time"
Expand Down Expand Up @@ -57,6 +58,22 @@ func NewExecutionServiceServerV1Alpha2(eth *eth.Ethereum) *ExecutionServiceServe
}
}

func (s *ExecutionServiceServerV1Alpha2) GetGenesisInfo(ctx context.Context, req *astriaPb.GetGenesisInfoRequest) (*astriaPb.GetGenesisInfoResponse, error) {
log.Info("GetGenesisInfo called", "request", req)

rollupId := sha256.Sum256([]byte(s.bc.Config().AstriaRollupName))

res := &astriaPb.GenesisInfo{
RollupId: rollupId[:],
SequencerGenesisBlockNumber: s.bc.Config().AstriaSequencerInitialHeight,
CelestiaBaseBlockNumber: s.bc.Config().AstriaDataAvailabilityInitialHeight,
CelestiaBlockVariance: s.bc.Config().AstriaDataAvailabilityHeightVariance,
}

log.Info("GetGenesisInfo completed", "response", res)
return res, nil
}

// GetBlock will return a block given an identifier.
func (s *ExecutionServiceServerV1Alpha2) GetBlock(ctx context.Context, req *astriaPb.GetBlockRequest) (*astriaPb.Block, error) {
log.Info("GetBlock called", "request", req)
Expand Down
8 changes: 5 additions & 3 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,10 @@ type ChainConfig struct {
// Astria Specific Configuration
AstriaOverrideGenesisExtraData bool `json:"astriaOverrideGenesisExtraData,omitempty"`
AstriaExtraDataOverride hexutil.Bytes `json:"astriaExtraDataOverride,omitempty"`
AstriaSequencerInitialHeight *big.Int `json:"astriaDequencerInitialHeight,omitempty"`
AstriaDataAvailabilityInitialHeight *big.Int `json:"astriaDataAvailabilityInitialHeight,omitempty"`
AstriaDataAvailabilityHeightVariance *big.Int `json:"astriaDataAvailabilityHeightVariance,omitempty"`
AstriaRollupName string `json:"astriaRollupName,omitempty"`
AstriaSequencerInitialHeight uint32 `json:"astriaDequencerInitialHeight,omitempty"`
AstriaDataAvailabilityInitialHeight uint32 `json:"astriaDataAvailabilityInitialHeight,omitempty"`
AstriaDataAvailabilityHeightVariance uint32 `json:"astriaDataAvailabilityHeightVariance,omitempty"`
}

func (c *ChainConfig) AstriaExtraData() []byte {
Expand All @@ -351,6 +352,7 @@ func (c *ChainConfig) AstriaExtraData() []byte {

// create default extradata
extra, _ := rlp.EncodeToBytes([]interface{}{
c.AstriaRollupName,
c.AstriaSequencerInitialHeight,
c.AstriaDataAvailabilityInitialHeight,
c.AstriaDataAvailabilityHeightVariance,
Expand Down

0 comments on commit d6df03e

Please sign in to comment.