Skip to content

Commit

Permalink
Use the latest version of RandomY based on RandomX 1.2.1 (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
SashaZezulinsky authored Oct 23, 2024
1 parent c3f682d commit dc4c61f
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 47 deletions.
94 changes: 70 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
name: go-core build
on: push
jobs:
build:
strategy:
matrix:
platform: [
{os: ubuntu-latest, path: linux-x86_64},
{os: windows-latest, path: windows-x86_64},
{os: raspbian-private, path: linux-arm64},
{os: macos-latest, path: darwin-x86_64},
]
runs-on: ${{ matrix.platform.os }}
build-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.21.x
go-version: 1.23
- name: Setup MSYS
if: ${{ matrix.platform.os == 'windows-latest' }}
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
Expand All @@ -34,25 +25,77 @@ jobs:
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-go
- name: Build Windows
if: ${{ matrix.platform.os == 'windows-latest' }}
shell: msys2 {0}
run: |
make gocore
make test
- name: Build
if: ${{ matrix.platform.os != 'windows-latest' }}
run: |
- name: Upload Gocore
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v3
with:
name: gocore-windows-x86_64
path: ./build/bin/gocore*

build-mac:
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {os: macos-13, path: darwin-x86_64}
- {os: macos-latest, path: darwin-arm64}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.23
- name: Build & Test
run: |
make gocore
make test
- name: Upload Gocore
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v3
with:
name: gocore-${{ matrix.config.path }}
path: ./build/bin/gocore*

build-alpine:
strategy:
matrix:
config:
- {arch: x86_64, branch: latest-stable}
- {arch: aarch64, branch: latest-stable}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Alpine Linux
uses: jirutka/setup-alpine@v1
with:
arch: ${{ matrix.config.arch }}
branch: ${{ matrix.config.branch }}
- name: Install deps
shell: alpine.sh --root {0}
run: apk add git cmake gcc g++ make go
- name: Safelist
shell: alpine.sh --root {0}
run: git config --global --add safe.directory ${{ github.workspace }}
- name: Build & Test
shell: alpine.sh --root {0}
run: |
make gocore
make test
- name: Upload Gocore
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: gocore-${{ matrix.platform.path }}
name: gocore-linux-${{ matrix.config.arch }}
path: ./build/bin/gocore*

release:
if: startsWith(github.ref, 'refs/tags/v')
needs: build
needs: [build-windows, build-mac, build-alpine]
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
Expand All @@ -72,6 +115,7 @@ jobs:
release_name: ${{ steps.version.outputs.tag }} gocore release
draft: false
prerelease: true

artifacts:
needs: release
runs-on: ubuntu-latest
Expand All @@ -80,12 +124,14 @@ jobs:
platform: [
{path: linux-x86_64, file_ext: ""},
{path: windows-x86_64, file_ext: ".exe"},
{path: linux-arm64, file_ext: ""},
{path: linux-aarch64, file_ext: ""},
{path: linux-riscv64, file_ext: ""},
{path: darwin-x86_64, file_ext: ""},
{path: darwin-arm64, file_ext: ""},
]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Artifact Gocore
uses: actions/download-artifact@v2
with:
Expand Down
27 changes: 20 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: Version
id: version
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
- name: Docker
run: echo "tag=$(echo ${GITHUB_REF:10})" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: network=host
- name: Install QEMU for Multi-Platform Builds
uses: docker/setup-qemu-action@v2
- name: Log in to GitHub Container Registry
run: |
docker login ghcr.io -u ${{github.actor}} -p ${{secrets.GITHUB_TOKEN}}
docker build . -t ghcr.io/core-coin/go-core:${{steps.version.outputs.tag}} -t ghcr.io/core-coin/go-core:latest
docker push ghcr.io/core-coin/go-core:${{steps.version.outputs.tag}}
docker push ghcr.io/core-coin/go-core:latest
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build and Push Docker Image for Multiple Architectures
run: |
docker buildx create --use
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag ghcr.io/core-coin/go-core:${{ steps.version.outputs.tag }} \
--tag ghcr.io/core-coin/go-core:latest \
--push .
- name: Verify Image Digest (Optional)
run: docker buildx imagetools inspect ghcr.io/core-coin/go-core:latest
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ RUN apk add make gcc g++ musl-dev linux-headers git
ADD . /go-core
RUN cd /go-core && make all

FROM alpine:3.14
FROM alpine:latest
RUN apk add gcc g++
COPY --from=builder /go-core/build/bin/* /usr/local/bin/
EXPOSE 30300 30300/udp
2 changes: 0 additions & 2 deletions cmd/gocore/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,6 @@ func gocore(ctx *cli.Context) error {
// it unlocks any requested accounts, and starts the RPC/IPC interfaces and the
// miner.
func startNode(ctx *cli.Context, stack *node.Node, backend xcbapi.Backend) {
debug.Memsize.Add("node", stack)

// Start up the node itself
utils.StartNode(stack)

Expand Down
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ require (
github.com/cespare/cp v0.1.0
github.com/cloudflare/cloudflare-go v0.10.2
github.com/core-coin/ed448 v1.0.2
github.com/core-coin/go-goldilocks v1.0.17
github.com/core-coin/go-randomy v0.0.19
github.com/core-coin/go-goldilocks v1.0.18
github.com/core-coin/go-randomy v0.0.21
github.com/core-coin/uint256 v1.0.0
github.com/davecgh/go-spew v1.1.1
github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea
github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf
github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498
github.com/fatih/color v1.7.0
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5
github.com/go-stack/stack v1.8.0
github.com/golang/snappy v0.0.3
github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ github.com/core-coin/ed448 v1.0.2 h1:t9fwBGw8i3HN8cISUlt4GA3TpYPNPR6xD09qtCuoyFA
github.com/core-coin/ed448 v1.0.2/go.mod h1:/S7hge2XKh2GI/dFp551tIsXDGGD6OU/CSRId+/OjII=
github.com/core-coin/go-goldilocks v1.0.17 h1:NLXGS0pbwrTfWo6ocPUxiTCMPIELVq9FtYdlrpJrm7U=
github.com/core-coin/go-goldilocks v1.0.17/go.mod h1:3GiDQX2tf7aIhnQoyL+N3pwU3a3IUuCeaFdOOFXCF/8=
github.com/core-coin/go-randomy v0.0.19 h1:Takoihc6nw/wL5FJjGqfmGB1da5GBy5RQK2VnXqn9OM=
github.com/core-coin/go-randomy v0.0.19/go.mod h1:gSn1tIjmiJC7c6GWbBXRlb75xvrruJZu3c/gDehBLCU=
github.com/core-coin/go-goldilocks v1.0.18 h1:dXC1BRnC6CvP8dH5CYVBQ2XWzevkOwt22mQwDh9yIO0=
github.com/core-coin/go-goldilocks v1.0.18/go.mod h1:3GiDQX2tf7aIhnQoyL+N3pwU3a3IUuCeaFdOOFXCF/8=
github.com/core-coin/go-randomy v0.0.21 h1:ImaAldP7HSEwWbC7+AMN3QzpxUN2MPp2MyZPdxtA6Vc=
github.com/core-coin/go-randomy v0.0.21/go.mod h1:gSn1tIjmiJC7c6GWbBXRlb75xvrruJZu3c/gDehBLCU=
github.com/core-coin/uint256 v1.0.0 h1:AzgINl9YCnYDRJBlqFlWsVb4sr814LcvPAvkPyVBFVo=
github.com/core-coin/uint256 v1.0.0/go.mod h1:rrinB/+X6+31MswTK2xwoFGi8i75SH1ILSsRSoOFa1I=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
Expand All @@ -108,8 +110,6 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
Expand Down
4 changes: 0 additions & 4 deletions internal/debug/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,11 @@ import (
"github.com/core-coin/go-core/v2/metrics"
"github.com/core-coin/go-core/v2/metrics/exp"

"github.com/fjl/memsize/memsizeui"
"github.com/mattn/go-colorable"
"github.com/mattn/go-isatty"
cli "gopkg.in/urfave/cli.v1"
)

var Memsize memsizeui.Handler

var (
verbosityFlag = cli.IntFlag{
Name: "verbosity",
Expand Down Expand Up @@ -156,7 +153,6 @@ func StartPProf(address string, withMetrics bool) {
if withMetrics {
exp.Exp(metrics.DefaultRegistry)
}
http.Handle("/memsize/", http.StripPrefix("/memsize", &Memsize))
log.Info("Starting pprof server", "addr", fmt.Sprintf("http://%s/debug/pprof", address))
go func() {
if err := http.ListenAndServe(address, nil); err != nil {
Expand Down
2 changes: 0 additions & 2 deletions mobile/gocore.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,6 @@ func NewNode(datadir string, config *NodeConfig) (stack *Node, _ error) {
return nil, err
}

debug.Memsize.Add("node", rawStack)

var genesis *core.Genesis
if config.CoreGenesis != "" {
// Parse the user supplied genesis spec if not mainnet
Expand Down

0 comments on commit dc4c61f

Please sign in to comment.