diff --git a/simulators/beacon/api/Dockerfile b/simulators/beacon/api/Dockerfile new file mode 100644 index 0000000000..085785dde0 --- /dev/null +++ b/simulators/beacon/api/Dockerfile @@ -0,0 +1,18 @@ +# Build the simulator binary +FROM golang:1-alpine AS builder +RUN apk --no-cache add gcc musl-dev linux-headers cmake make clang build-base clang-static clang-dev + +# Prepare workspace. +# Note: the build context of this simulator image is the parent directory! +ADD . /source + +# Build within simulator folder +WORKDIR /source +RUN go build -o ./sim . + +# Build the runner container. +FROM alpine:latest +ADD . / +COPY --from=builder /source/sim / + +ENTRYPOINT ["./sim"] diff --git a/simulators/beacon/api/go.mod b/simulators/beacon/api/go.mod new file mode 100644 index 0000000000..49ef671f45 --- /dev/null +++ b/simulators/beacon/api/go.mod @@ -0,0 +1,34 @@ +module github.com/ethereum/hive/simulators/beacon/api + +go 1.20 + +require ( + github.com/ethereum/hive v0.0.0-20230516150403-448156fa839e + github.com/golang/snappy v0.0.4 + github.com/holiman/uint256 v1.2.1 + github.com/pkg/errors v0.9.1 + github.com/protolambda/zrnt v0.30.0 + github.com/protolambda/ztyp v0.2.2 + gopkg.in/yaml.v3 v3.0.1 +) + +require ( + github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/deckarep/golang-set/v2 v2.1.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect + github.com/ethereum/go-ethereum v1.11.4 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect + github.com/go-stack/stack v1.8.1 // indirect + github.com/gorilla/websocket v1.5.0 // indirect + github.com/kilic/bls12-381 v0.1.0 // indirect + github.com/minio/sha256-simd v0.1.0 // indirect + github.com/protolambda/bls12-381-util v0.0.0-20210720105258-a772f2aac13e // indirect + github.com/shirou/gopsutil v3.21.11+incompatible // indirect + github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect + github.com/tklauser/go-sysconf v0.3.11 // indirect + github.com/tklauser/numcpus v0.6.0 // indirect + github.com/yusufpapurcu/wmi v1.2.2 // indirect + golang.org/x/crypto v0.4.0 // indirect + golang.org/x/sys v0.5.0 // indirect + gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect +) diff --git a/simulators/beacon/api/go.sum b/simulators/beacon/api/go.sum new file mode 100644 index 0000000000..d1aa6d6351 --- /dev/null +++ b/simulators/beacon/api/go.sum @@ -0,0 +1,176 @@ +github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= +github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= +github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= +github.com/ethereum/go-ethereum v1.11.4 h1:KG81SnUHXWk8LJB3mBcHg/E2yLvXoiPmRMCIRxgx3cE= +github.com/ethereum/go-ethereum v1.11.4/go.mod h1:it7x0DWnTDMfVFdXcU6Ti4KEFQynLHVRarcSlPr0HBo= +github.com/ethereum/hive v0.0.0-20230516150403-448156fa839e h1:JB3owrEiwh+RNr4vbjaUUO6RoWl7CJ+cliq8AJPsdbk= +github.com/ethereum/hive v0.0.0-20230516150403-448156fa839e/go.mod h1:zKL2DscVzRusnGVpseAvLrXGJ3qrGHuSfOIrv4JfnRk= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= +github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= +github.com/holiman/uint256 v1.2.1 h1:XRtyuda/zw2l+Bq/38n5XUoEF72aSOu/77Thd9pPp2o= +github.com/holiman/uint256 v1.2.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/kilic/bls12-381 v0.1.0 h1:encrdjqKMEvabVQ7qYOKu1OvhqpK4s47wDYtNiPtlp4= +github.com/kilic/bls12-381 v0.1.0/go.mod h1:vDTTHJONJ6G+P2R74EhnyotQDTliQDnFEwhdmfzw1ig= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/minio/sha256-simd v0.1.0 h1:U41/2erhAKcmSI14xh/ZTUdBPOzDOIfS93ibzUSl8KM= +github.com/minio/sha256-simd v0.1.0/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/protolambda/bls12-381-util v0.0.0-20210720105258-a772f2aac13e h1:ugvwIKDzqL6ODJciRPMm+9xFQ5AlOYHeMpCOeEuP7LA= +github.com/protolambda/bls12-381-util v0.0.0-20210720105258-a772f2aac13e/go.mod h1:MPZvj2Pr0N8/dXyTPS5REeg2sdLG7t8DRzC1rLv925w= +github.com/protolambda/messagediff v1.4.0/go.mod h1:LboJp0EwIbJsePYpzh5Op/9G1/4mIztMRYzzwR0dR2M= +github.com/protolambda/zrnt v0.30.0 h1:pHEn69ZgaDFGpLGGYG1oD7DvYI7RDirbMBPfbC+8p4g= +github.com/protolambda/zrnt v0.30.0/go.mod h1:qcdX9CXFeVNCQK/q0nswpzhd+31RHMk2Ax/2lMsJ4Jw= +github.com/protolambda/ztyp v0.2.2 h1:rVcL3vBu9W/aV646zF6caLS/dyn9BN8NYiuJzicLNyY= +github.com/protolambda/ztyp v0.2.2/go.mod h1:9bYgKGqg3wJqT9ac1gI2hnVb0STQq7p/1lapqrqY1dU= +github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= +github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a h1:1ur3QoCqvE5fl+nylMaIr9PVV1w343YRDtsy+Rwu7XI= +github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= +github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= +github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= +github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= +github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= +github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8= +golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201101102859-da207088b7d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/inconshreveable/log15.v2 v2.0.0-20200109203555-b30bc20e4fd1 h1:iiHuQZCNgYPmFQxd3BBN/Nc5+dAwzZuq5y40s20oQw0= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/simulators/beacon/api/main.go b/simulators/beacon/api/main.go new file mode 100644 index 0000000000..9dea8e4e77 --- /dev/null +++ b/simulators/beacon/api/main.go @@ -0,0 +1,371 @@ +package main + +import ( + "bytes" + "fmt" + "io" + "io/ioutil" + "os" + "path" + "path/filepath" + "regexp" + "strconv" + "strings" + "sync" + + "github.com/pkg/errors" + + "github.com/ethereum/hive/hivesim" + "github.com/golang/snappy" + "github.com/holiman/uint256" + "github.com/protolambda/zrnt/eth2/beacon/common" + "github.com/protolambda/zrnt/eth2/configs" + "github.com/protolambda/ztyp/view" + "gopkg.in/yaml.v3" +) + +const ( + PortBeaconTCP = 9000 + PortBeaconUDP = 9000 + PortBeaconAPI = 4000 + PortBeaconGRPC = 4001 + PortMetrics = 8080 + PortValidatorAPI = 5000 + FarFutureEpoch = common.Epoch(0xffffffffffffffff) +) + +func main() { + suite := hivesim.Suite{ + Name: "beacon-api", + } + suite.Add(hivesim.TestSpec{ + Name: "test file loader", + Description: "This is a meta-test. It loads the tests for the beacon api.", + Run: loaderTest, + AlwaysRun: true, + }) + hivesim.MustRunSuite(hivesim.New(), suite) +} + +// loaderTest loads the blockchain test files and spawns the client tests. +func loaderTest(t *hivesim.T) { + clientTypes, err := t.Sim.ClientTypes() + if err != nil { + t.Fatal("can't get client types:", err) + } + + parallelism := 16 + if val, ok := os.LookupEnv("HIVE_PARALLELISM"); ok { + if p, err := strconv.Atoi(val); err != nil { + t.Logf("Warning: invalid HIVE_PARALLELISM value %q", val) + } else { + parallelism = p + } + } + t.Log("parallelism:", parallelism) + + // Find the tests directory. + /* + testPath, isset := os.LookupEnv("TESTPATH") + if !isset { + t.Fatal("$TESTPATH not set") + } + fileRoot := fmt.Sprintf("%s/BlockchainTests/", testPath) + */ + + // Spawn workers. + var wg sync.WaitGroup + var testCh = make(chan *BeaconAPITest) + wg.Add(parallelism) + for i := 0; i < parallelism; i++ { + go func() { + defer wg.Done() + for test := range testCh { + t.Run(hivesim.TestSpec{ + Name: test.Name, + Run: test.Run, + // Regexp matching on Name is disabled here because it's already done + // in loadTests. Matching in loadTests is better because it has access + // to the full test file path. + AlwaysRun: true, + }) + } + }() + } + + _, testPattern := t.Sim.TestPattern() + re := regexp.MustCompile(testPattern) + + // Deliver test cases. + loadTests(t, "tests", re, func(tc BeaconAPITest) { + for _, client := range clientTypes { + if !client.HasRole("beacon") { + continue + } + tc := tc // shallow copy + tc.ClientType = client.Name + testCh <- &tc + } + }) + close(testCh) + + // Wait for workers to finish. + wg.Wait() +} + +func checkTestFiles(dirPath string) bool { + requiredFiles := []string{"post.ssz_snappy", "beacon_api.yaml", "blocks_0.ssz_snappy", "meta.yaml"} + // Check that all minimum required files are present + for _, file := range requiredFiles { + if _, err := os.Stat(path.Join(dirPath, file)); os.IsNotExist(err) { + return false + } + } + return true +} + +func loadTests(t *hivesim.T, root string, re *regexp.Regexp, fn func(BeaconAPITest)) { + // Walk through the tests directory, each directory is a test + filepath.Walk(root, func(walkpath string, info os.FileInfo, err error) error { + if err != nil { + t.Logf("unable to walk path: %s", err) + return err + } + if !info.IsDir() { + return nil + } + if !checkTestFiles(walkpath) { + return nil // skip + } + if !re.MatchString(info.Name()) { + fmt.Println("skip", info.Name()) + return nil // skip + } + test := BeaconAPITest{ + Name: info.Name(), + Path: walkpath, + } + if err := test.LoadFromDirectory(walkpath); err != nil { + fmt.Println(walkpath) + return nil + } + if preset_str, _, err := test.PresetFork(); err != nil { + fmt.Println("skip", info.Name()) + return nil + } else if preset_str != "devnet" { + fmt.Println("skip", info.Name()) + return nil + } + fn(test) + return nil + }) +} + +type BeaconAPIChecks struct { + StateRoot string `yaml:"state_root"` +} +type BeaconAPITest struct { + // The name of the test + Name string + // Path to the test dir + Path string + // Post state + Post []byte + // Post state + Pre []byte + // Genesis state + Genesis []byte + // The blocks to process + Blocks [][]byte + // The checks to perform + Checks BeaconAPIChecks + + ClientType string +} + +func (b *BeaconAPITest) LoadFromDirectory(dirPath string) error { + // Read and uncompress post state + compressedPost, err := os.ReadFile(path.Join(dirPath, "post.ssz_snappy")) + if err != nil { + return err + } + // Uncompress post state using snappy + b.Post, err = snappy.Decode(nil, compressedPost) + if err != nil { + return err + } + // Read and uncompress pre state + compressedPre, err := os.ReadFile(path.Join(dirPath, "pre.ssz_snappy")) + if err != nil { + return err + } + // Uncompress pre state using snappy + b.Pre, err = snappy.Decode(nil, compressedPre) + if err != nil { + return err + } + // Read and uncompress genesis state + compressedGenesis, err := os.ReadFile(path.Join(dirPath, "genesis.ssz_snappy")) + if err != nil { + return err + } + // Uncompress genesis state using snappy + b.Genesis, err = snappy.Decode(nil, compressedGenesis) + if err != nil { + return err + } + + // Read and uncompress blocks: each block is a file with the following format: blocks_{i}.ssz_snappy + // where i is the index of the block + // Read each block starting from zero until the block file does not exist + b.Blocks = make([][]byte, 0) + for i := 0; ; i++ { + blockPath := path.Join(dirPath, fmt.Sprintf("blocks_%d.ssz_snappy", i)) + if _, err := os.Stat(blockPath); os.IsNotExist(err) { + break + } + // Read and uncompress block + compressedBlock, err := os.ReadFile(blockPath) + if err != nil { + return err + } + block, err := snappy.Decode(nil, compressedBlock) + if err != nil { + return err + } + b.Blocks = append(b.Blocks, block) + } + + // Read checks + checksPath := path.Join(dirPath, "beacon_api.yaml") + if _, err := os.Stat(checksPath); os.IsNotExist(err) { + return err + } + checksFile, err := os.ReadFile(checksPath) + if err != nil { + return err + } + if err := yaml.Unmarshal(checksFile, &b.Checks); err != nil { + return err + } + + return nil +} + +func (b *BeaconAPITest) Run(t *hivesim.T) { + configBundle, err := b.ConfigBundle() + if err != nil { + t.Fatalf("failed to create config bundle: %v", err) + } + b.ConsensusConfig() + t.StartClient(b.ClientType, configBundle) +} + +func BytesSource(data []byte) func() (io.ReadCloser, error) { + return func() (io.ReadCloser, error) { + return ioutil.NopCloser(bytes.NewReader(data)), nil + } +} + +func (b *BeaconAPITest) PresetFork() (string, string, error) { + paths := strings.Split(b.Path, string(os.PathSeparator)) + if len(paths) < 3 { + return "", "", fmt.Errorf("unable to extract config from path: %s", b.Path) + } + return paths[1], paths[2], nil +} +func (b *BeaconAPITest) ConsensusConfig() (*common.Spec, error) { + preset_str, fork_str, err := b.PresetFork() + if err != nil { + return nil, err + } + var spec *common.Spec + switch preset_str { + case "mainnet": + specCpy := *configs.Mainnet + spec = &specCpy + case "minimal": + specCpy := *configs.Minimal + spec = &specCpy + case "devnet": + specCpy := *configs.Mainnet + spec = &specCpy + spec.Config.GENESIS_FORK_VERSION = common.Version{0x00, 0x00, 0x00, 0x0a} + spec.Config.ALTAIR_FORK_VERSION = common.Version{0x01, 0x00, 0x00, 0x0a} + spec.Config.BELLATRIX_FORK_VERSION = common.Version{0x02, 0x00, 0x00, 0x0a} + spec.Config.CAPELLA_FORK_VERSION = common.Version{0x03, 0x00, 0x00, 0x0a} + spec.Config.DENEB_FORK_VERSION = common.Version{0x04, 0x00, 0x00, 0x0a} + default: + return nil, fmt.Errorf("unknown preset: %s", preset_str) + } + // Set genesis time + + // Reset fork epochs to far future + spec.Config.ALTAIR_FORK_EPOCH = FarFutureEpoch + spec.Config.BELLATRIX_FORK_EPOCH = FarFutureEpoch + spec.Config.CAPELLA_FORK_EPOCH = FarFutureEpoch + spec.Config.DENEB_FORK_EPOCH = FarFutureEpoch + + tdd := uint256.NewInt(0) + + switch fork_str { + case "phase0": + // Nothing to do + case "altair": + spec.Config.ALTAIR_FORK_EPOCH = 0 + case "bellatrix": + spec.Config.ALTAIR_FORK_EPOCH = 0 + spec.Config.BELLATRIX_FORK_EPOCH = 0 + case "capella": + spec.Config.ALTAIR_FORK_EPOCH = 0 + spec.Config.BELLATRIX_FORK_EPOCH = 0 + spec.Config.CAPELLA_FORK_EPOCH = 0 + spec.Config.TERMINAL_TOTAL_DIFFICULTY = view.Uint256View(*tdd) + case "deneb": + spec.Config.ALTAIR_FORK_EPOCH = 0 + spec.Config.BELLATRIX_FORK_EPOCH = 0 + spec.Config.CAPELLA_FORK_EPOCH = 0 + spec.Config.DENEB_FORK_EPOCH = 0 + spec.Config.TERMINAL_TOTAL_DIFFICULTY = view.Uint256View(*tdd) + default: + return nil, fmt.Errorf("unknown fork: %s", fork_str) + } + + return spec, nil +} + +func (b *BeaconAPITest) ConfigBundle() (hivesim.StartOption, error) { + // Get the config + spec, err := b.ConsensusConfig() + if err != nil { + return nil, errors.Wrap(err, "failed to get consensus config") + } + specConfig, err := yaml.Marshal(spec.Config) + if err != nil { + return nil, err + } + return hivesim.Bundle( + hivesim.Params{ + "HIVE_CHECK_LIVE_PORT": fmt.Sprintf( + "%d", + PortBeaconAPI, + ), + }, + hivesim.WithDynamicFile( + "/hive/input/config.yaml", + BytesSource(specConfig), + ), + hivesim.WithDynamicFile( + "/hive/input/genesis.ssz", + BytesSource(b.Genesis), + ), + hivesim.WithDynamicFile( + "/hive/input/checkpoint_block.ssz", + BytesSource(b.Blocks[len(b.Blocks)-1]), + ), + hivesim.WithDynamicFile( + "/hive/input/checkpoint_state.ssz", + BytesSource(b.Post), + ), + ), nil +} diff --git a/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/beacon_api.yaml b/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/beacon_api.yaml new file mode 100644 index 0000000000..cae781c594 --- /dev/null +++ b/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/beacon_api.yaml @@ -0,0 +1 @@ +{state_root: a29214f2cb71d8b1c9e5e24aa7eb5552e392803b892fb05b3594713a2fabbf3b} diff --git a/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/blocks_0.ssz_snappy b/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/blocks_0.ssz_snappy new file mode 100644 index 0000000000..abc1a5634b Binary files /dev/null and b/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/blocks_0.ssz_snappy differ diff --git a/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/blocks_1.ssz_snappy b/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/blocks_1.ssz_snappy new file mode 100644 index 0000000000..a41b714b79 Binary files /dev/null and b/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/blocks_1.ssz_snappy differ diff --git a/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/genesis.ssz_snappy b/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/genesis.ssz_snappy new file mode 100644 index 0000000000..3f1445bb48 Binary files /dev/null and b/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/genesis.ssz_snappy differ diff --git a/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/meta.yaml b/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/meta.yaml new file mode 100644 index 0000000000..b3ac963c0a --- /dev/null +++ b/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/meta.yaml @@ -0,0 +1 @@ +{blocks_count: 2} diff --git a/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/post.ssz_snappy b/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/post.ssz_snappy new file mode 100644 index 0000000000..619c8a87e2 Binary files /dev/null and b/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/post.ssz_snappy differ diff --git a/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/pre.ssz_snappy b/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/pre.ssz_snappy new file mode 100644 index 0000000000..0561b9998a Binary files /dev/null and b/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api/pre.ssz_snappy differ diff --git a/simulators/beacon/api/tests/diagnostics.json b/simulators/beacon/api/tests/diagnostics.json new file mode 100644 index 0000000000..effa613445 --- /dev/null +++ b/simulators/beacon/api/tests/diagnostics.json @@ -0,0 +1 @@ +{"collected_test_count": 12, "generated_test_count": 8, "skipped_test_count": 0, "test_identifiers": ["mainnet::capella::api::api::pyspec_tests::beacon_api", "mainnet::capella::api::api::pyspec_tests::beacon_api", "mainnet::capella::api::api::pyspec_tests::beacon_api", "mainnet::capella::api::api::pyspec_tests::beacon_api", "minimal::capella::api::api::pyspec_tests::beacon_api", "devnet::capella::api::api::pyspec_tests::beacon_api", "devnet::capella::api::api::pyspec_tests::beacon_api", "devnet::capella::api::api::pyspec_tests::beacon_api"], "durations": ["0.0 seconds", "7.5 seconds", "0.0 seconds", "7.45 seconds", "0.0 seconds", "7.48 seconds", "0.0 seconds", "7.43 seconds", "0.0 seconds", "7.45 seconds", "0.0 seconds", "7.4 seconds", "0.25 seconds", "0.0 seconds", "0.0 seconds", "0.0 seconds", "0.0 seconds", "0.0 seconds", "0.0 seconds", "0.0 seconds", "0.0 seconds", "0.0 seconds", "7.26 seconds", "0.0 seconds", "0.0 seconds", "7.29 seconds", "0.0 seconds", "0.0 seconds", "7.65 seconds", "0.0 seconds", "0.0 seconds", "6.08 seconds", "0.0 seconds", "0.0 seconds", "7.79 seconds"]} \ No newline at end of file diff --git a/simulators/beacon/api/tests/diagnostics.json.lock b/simulators/beacon/api/tests/diagnostics.json.lock new file mode 100644 index 0000000000..e69de29bb2 diff --git a/simulators/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api/beacon_api.yaml b/simulators/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api/beacon_api.yaml new file mode 100644 index 0000000000..5dfedc4fc0 --- /dev/null +++ b/simulators/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api/beacon_api.yaml @@ -0,0 +1 @@ +{state_root: b3f54c80c0abc26d0adc4d8d98ff9b579ac38100ce92cae3f5be21976ac5e90a} diff --git a/simulators/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api/blocks_0.ssz_snappy b/simulators/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api/blocks_0.ssz_snappy new file mode 100644 index 0000000000..04ef89b924 Binary files /dev/null and b/simulators/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api/blocks_0.ssz_snappy differ diff --git a/simulators/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api/blocks_1.ssz_snappy b/simulators/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api/blocks_1.ssz_snappy new file mode 100644 index 0000000000..6c43982a09 Binary files /dev/null and b/simulators/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api/blocks_1.ssz_snappy differ diff --git a/simulators/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api/meta.yaml b/simulators/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api/meta.yaml new file mode 100644 index 0000000000..b3ac963c0a --- /dev/null +++ b/simulators/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api/meta.yaml @@ -0,0 +1 @@ +{blocks_count: 2} diff --git a/simulators/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api/post.ssz_snappy b/simulators/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api/post.ssz_snappy new file mode 100644 index 0000000000..acce88e494 Binary files /dev/null and b/simulators/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api/post.ssz_snappy differ diff --git a/simulators/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api/pre.ssz_snappy b/simulators/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api/pre.ssz_snappy new file mode 100644 index 0000000000..b24de74353 Binary files /dev/null and b/simulators/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api/pre.ssz_snappy differ diff --git a/simulators/beacon/api/tests/minimal/capella/api/api/pyspec_tests/beacon_api/beacon_api.yaml b/simulators/beacon/api/tests/minimal/capella/api/api/pyspec_tests/beacon_api/beacon_api.yaml new file mode 100644 index 0000000000..a23ba67c4d --- /dev/null +++ b/simulators/beacon/api/tests/minimal/capella/api/api/pyspec_tests/beacon_api/beacon_api.yaml @@ -0,0 +1 @@ +{state_root: 0578e2e9e17ec5384e20887848bb17caac73218417a69533acc904098b8e0108} diff --git a/simulators/beacon/api/tests/minimal/capella/api/api/pyspec_tests/beacon_api/blocks_0.ssz_snappy b/simulators/beacon/api/tests/minimal/capella/api/api/pyspec_tests/beacon_api/blocks_0.ssz_snappy new file mode 100644 index 0000000000..11746e156f Binary files /dev/null and b/simulators/beacon/api/tests/minimal/capella/api/api/pyspec_tests/beacon_api/blocks_0.ssz_snappy differ diff --git a/simulators/beacon/api/tests/minimal/capella/api/api/pyspec_tests/beacon_api/blocks_1.ssz_snappy b/simulators/beacon/api/tests/minimal/capella/api/api/pyspec_tests/beacon_api/blocks_1.ssz_snappy new file mode 100644 index 0000000000..7bf8c2c3d1 Binary files /dev/null and b/simulators/beacon/api/tests/minimal/capella/api/api/pyspec_tests/beacon_api/blocks_1.ssz_snappy differ diff --git a/simulators/beacon/api/tests/minimal/capella/api/api/pyspec_tests/beacon_api/meta.yaml b/simulators/beacon/api/tests/minimal/capella/api/api/pyspec_tests/beacon_api/meta.yaml new file mode 100644 index 0000000000..b3ac963c0a --- /dev/null +++ b/simulators/beacon/api/tests/minimal/capella/api/api/pyspec_tests/beacon_api/meta.yaml @@ -0,0 +1 @@ +{blocks_count: 2} diff --git a/simulators/beacon/api/tests/minimal/capella/api/api/pyspec_tests/beacon_api/post.ssz_snappy b/simulators/beacon/api/tests/minimal/capella/api/api/pyspec_tests/beacon_api/post.ssz_snappy new file mode 100644 index 0000000000..0032d29e52 Binary files /dev/null and b/simulators/beacon/api/tests/minimal/capella/api/api/pyspec_tests/beacon_api/post.ssz_snappy differ diff --git a/simulators/beacon/api/tests/minimal/capella/api/api/pyspec_tests/beacon_api/pre.ssz_snappy b/simulators/beacon/api/tests/minimal/capella/api/api/pyspec_tests/beacon_api/pre.ssz_snappy new file mode 100644 index 0000000000..4c39a595cf Binary files /dev/null and b/simulators/beacon/api/tests/minimal/capella/api/api/pyspec_tests/beacon_api/pre.ssz_snappy differ diff --git a/simulators/beacon/api/tests/testgen_error_log.txt b/simulators/beacon/api/tests/testgen_error_log.txt new file mode 100644 index 0000000000..39ec3f45f2 --- /dev/null +++ b/simulators/beacon/api/tests/testgen_error_log.txt @@ -0,0 +1,86 @@ +[ERROR] failed to generate vector(s) for test /home/marioevz/Development/Eth/hive/simulators/eth2/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api: cannot represent an object: Configuration(PRESET_BASE='mainnet', MIN_GENESIS_ACTIVE_VALIDATOR_COUNT=16384, MIN_GENESIS_TIME=1606824000, GENESIS_FORK_VERSION=0x00000000, GENESIS_DELAY=604800, SECONDS_PER_SLOT=12, SECONDS_PER_ETH1_BLOCK=14, MIN_VALIDATOR_WITHDRAWABILITY_DELAY=256, SHARD_COMMITTEE_PERIOD=256, ETH1_FOLLOW_DISTANCE=2048, EJECTION_BALANCE=16000000000, MIN_PER_EPOCH_CHURN_LIMIT=4, CHURN_LIMIT_QUOTIENT=65536, PROPOSER_SCORE_BOOST=40, INACTIVITY_SCORE_BIAS=4, INACTIVITY_SCORE_RECOVERY_RATE=16, ALTAIR_FORK_VERSION=0x01000000, ALTAIR_FORK_EPOCH=74240, TERMINAL_TOTAL_DIFFICULTY=58750000000000000000000, TERMINAL_BLOCK_HASH=0x0000000000000000000000000000000000000000000000000000000000000000, TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH=18446744073709551615, BELLATRIX_FORK_VERSION=0x02000000, BELLATRIX_FORK_EPOCH=144896, CAPELLA_FORK_VERSION=0x03000000, CAPELLA_FORK_EPOCH=194048)Traceback (most recent call last): + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/eth2spec/gen_helpers/gen_base/gen_runner.py", line 207, in run_generator + output_part(out_kind, name, dump_yaml_fn(data, name, file_mode, yaml)) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/eth2spec/gen_helpers/gen_base/gen_runner.py", line 184, in output_part + fn(case_dir) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/eth2spec/gen_helpers/gen_base/gen_runner.py", line 294, in dump + yaml_encoder.dump(data, f) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/main.py", line 574, in dump + return self.dump_all([data], stream, transform=transform) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/main.py", line 583, in dump_all + self._context_manager.dump(data) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/main.py", line 915, in dump + self._yaml.representer.represent(data) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/representer.py", line 80, in represent + node = self.represent_data(data) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/representer.py", line 113, in represent_data + node = self.yaml_representers[None](self, data) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/representer.py", line 354, in represent_undefined + raise RepresenterError(_F('cannot represent an object: {data!s}', data=data)) +ruamel.yaml.representer.RepresenterError: cannot represent an object: Configuration(PRESET_BASE='mainnet', MIN_GENESIS_ACTIVE_VALIDATOR_COUNT=16384, MIN_GENESIS_TIME=1606824000, GENESIS_FORK_VERSION=0x00000000, GENESIS_DELAY=604800, SECONDS_PER_SLOT=12, SECONDS_PER_ETH1_BLOCK=14, MIN_VALIDATOR_WITHDRAWABILITY_DELAY=256, SHARD_COMMITTEE_PERIOD=256, ETH1_FOLLOW_DISTANCE=2048, EJECTION_BALANCE=16000000000, MIN_PER_EPOCH_CHURN_LIMIT=4, CHURN_LIMIT_QUOTIENT=65536, PROPOSER_SCORE_BOOST=40, INACTIVITY_SCORE_BIAS=4, INACTIVITY_SCORE_RECOVERY_RATE=16, ALTAIR_FORK_VERSION=0x01000000, ALTAIR_FORK_EPOCH=74240, TERMINAL_TOTAL_DIFFICULTY=58750000000000000000000, TERMINAL_BLOCK_HASH=0x0000000000000000000000000000000000000000000000000000000000000000, TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH=18446744073709551615, BELLATRIX_FORK_VERSION=0x02000000, BELLATRIX_FORK_EPOCH=144896, CAPELLA_FORK_VERSION=0x03000000, CAPELLA_FORK_EPOCH=194048) + +[ERROR] failed to generate vector(s) for test /home/marioevz/Development/Eth/hive/simulators/eth2/beacon/api/tests/mainnet/capella/api/api/pyspec_tests/beacon_api: cannot represent an object: 16384Traceback (most recent call last): + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/eth2spec/gen_helpers/gen_base/gen_runner.py", line 207, in run_generator + output_part(out_kind, name, dump_yaml_fn(data, name, file_mode, yaml)) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/eth2spec/gen_helpers/gen_base/gen_runner.py", line 184, in output_part + fn(case_dir) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/eth2spec/gen_helpers/gen_base/gen_runner.py", line 294, in dump + yaml_encoder.dump(data, f) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/main.py", line 574, in dump + return self.dump_all([data], stream, transform=transform) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/main.py", line 583, in dump_all + self._context_manager.dump(data) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/main.py", line 915, in dump + self._yaml.representer.represent(data) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/representer.py", line 80, in represent + node = self.represent_data(data) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/representer.py", line 103, in represent_data + node = self.yaml_representers[data_types[0]](self, data) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/representer.py", line 321, in represent_dict + return self.represent_mapping('tag:yaml.org,2002:map', data) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/representer.py", line 869, in represent_mapping + node_value = self.represent_data(item_value) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/representer.py", line 113, in represent_data + node = self.yaml_representers[None](self, data) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/representer.py", line 354, in represent_undefined + raise RepresenterError(_F('cannot represent an object: {data!s}', data=data)) +ruamel.yaml.representer.RepresenterError: cannot represent an object: 16384 + +[ERROR] failed to generate vector(s) for test /home/marioevz/Development/Eth/hive/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api: cannot represent an object: 16384Traceback (most recent call last): + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/eth2spec/gen_helpers/gen_base/gen_runner.py", line 207, in run_generator + output_part(out_kind, name, dump_yaml_fn(data, name, file_mode, yaml)) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/eth2spec/gen_helpers/gen_base/gen_runner.py", line 184, in output_part + fn(case_dir) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/eth2spec/gen_helpers/gen_base/gen_runner.py", line 294, in dump + yaml_encoder.dump(data, f) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/main.py", line 574, in dump + return self.dump_all([data], stream, transform=transform) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/main.py", line 583, in dump_all + self._context_manager.dump(data) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/main.py", line 915, in dump + self._yaml.representer.represent(data) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/representer.py", line 80, in represent + node = self.represent_data(data) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/representer.py", line 103, in represent_data + node = self.yaml_representers[data_types[0]](self, data) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/representer.py", line 321, in represent_dict + return self.represent_mapping('tag:yaml.org,2002:map', data) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/representer.py", line 869, in represent_mapping + node_value = self.represent_data(item_value) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/representer.py", line 113, in represent_data + node = self.yaml_representers[None](self, data) + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/ruamel/yaml/representer.py", line 354, in represent_undefined + raise RepresenterError(_F('cannot represent an object: {data!s}', data=data)) +ruamel.yaml.representer.RepresenterError: cannot represent an object: 16384 + +[ERROR] failed to generate vector(s) for test /home/marioevz/Development/Eth/hive/simulators/beacon/api/tests/devnet/capella/api/api/pyspec_tests/beacon_api: module 'eth2spec.capella.devnet' has no attribute 'MIN_GENESIS_TIME'Traceback (most recent call last): + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/eth2spec/gen_helpers/gen_base/gen_runner.py", line 200, in run_generator + for (name, out_kind, data) in test_case.case_fn(): + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/eth2spec/test/utils/utils.py", line 31, in generator_mode + for data in fn(*args, **kw): + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/eth2spec/test/context.py", line 382, in entry + yield from res + File "/home/marioevz/Development/Eth/consensus-specs/tests/generators/api/venv/lib/python3.10/site-packages/eth2spec/test/capella/api/test_api.py", line 66, in test_beacon_api + state.genesis_time = spec.MIN_GENESIS_TIME +AttributeError: module 'eth2spec.capella.devnet' has no attribute 'MIN_GENESIS_TIME' +