Skip to content

Commit

Permalink
V0.2.12 candidate (#5)
Browse files Browse the repository at this point in the history
* core/vm: rework jumpdest analysis benchmarks (#23499)

* core/vm: rework jumpdest analysis benchmarks

For BenchmarkJumpdestOpAnalysis use fixed code size of ~1.2MB
and classic benchmark loop.

* core/vm: clear bitvec in jumpdest analysis benchmark

* docs: add links to more audits in SECURITY.md (#23482)

* core: fix typo in iterator.go (#23502)

strorage -> storage

* common: fixes format verb (#23495)

* core: fix race conditions in txpool (#23474)

* core: fix race conditions in txpool

* core: fixed races in the txpool

* core: rebased on master

* core: move reheap mutex

* core: renamed mutex

* core: revert Reheap changes

* cmd/evm: add tests for evm t8n (#23507)

* trie: add missing copyright header (#23530)

* Add missing copyright header

* Update stacktrie_test.go

Co-authored-by: Péter Szilágyi <peterke@gmail.com>

* docs: add post-mortem (#23518)

* docs: add post-mortem

* Update docs/postmortems/2021-08-22-split-postmortem.md

Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>

* Update docs/postmortems/2021-08-22-split-postmortem.md

Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>

* Update docs/postmortems/2021-08-22-split-postmortem.md

Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>

* Update docs/postmortems/2021-08-22-split-postmortem.md

* Update 2021-08-22-split-postmortem.md

* Update docs/postmortems/2021-08-22-split-postmortem.md

Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>

Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>

* internal/debug: remove deprecated flags (#23368)

* internal/debug: remove deprecated flags

The removed flags are removed in the main portion of geth, this removes it internally too.

* internal/debug: remove legacy --debug and legacy --backtrace flag

* Update flags.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

* cmd/geth, cmd/utils: remove legacy rpc flags (#23358)

* remove rpc flags

* remove legacy rpc flags

* remove legacy rpc flags

* remove legacy rpc commands

* (hopefully) fix most of the build errors

* fix build errors

https://app.travis-ci.com/github/ethereum/go-ethereum/jobs/530318686

* cmd/utils: fix syntax error

* empty commit to unbreak travis ci

* fix syntax error

* syntax fixes

* syntax fixes

* fix

fixes "cmd/geth/usage.go:234:7: expected '(', found init (typecheck)"

* fix

* various fixes in usage.go

* various fixes in flags.go

* adds extra space

reverts the spacing to how it was before I resolved the merge conflict

* more fixes in usage.go

* fix

fix for cmd/geth/usage.go:243:17: expected operand, found ':=' (typecheck) in travis

* Update cmd/utils/flags.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

* fix error

 fixes these errors:
cmd/utils/flags_legacy.go:21:2: "strings" imported but not used (typecheck)

	"strings"

	^

cmd/utils/flags_legacy.go:24:2: "github.com/ethereum/go-ethereum/node" imported but not used (typecheck)

	"github.com/ethereum/go-ethereum/node"

	^

* goimports

Co-authored-by: Martin Holst Swende <martin@swende.se>

* core/rawdb: freezer batch write (#23462)

This change is a rewrite of the freezer code.

When writing ancient chain data to the freezer, the previous version first encoded each
individual item to a temporary buffer, then wrote the buffer. For small item sizes (for
example, in the block hash freezer table), this strategy causes a lot of system calls for
writing tiny chunks of data. It also allocated a lot of temporary []byte buffers.

In the new version, we instead encode multiple items into a re-useable batch buffer, which
is then written to the file all at once. This avoids performing a system call for every
inserted item.

To make the internal batching work, the ancient database API had to be changed. While
integrating this new API in BlockChain.InsertReceiptChain, additional optimizations were
also added there.

Co-authored-by: Felix Lange <fjl@twurst.com>

* p2p/enode: use unix timestamp as base ENR sequence number (#19903)

This PR ensures that wiping all data associated with a node (apart from its nodekey)
will not generate already used sequence number for the ENRs, since all remote nodes
would reject them until they out-number the previously published largest one.

The big complication with this scheme is that every local update to the ENR can
potentially bump the sequence number by one. In order to ensure that local updates
do not outrun the clock, the sequence number is a millisecond-precision timestamp,
and updates are throttled to occur at most once per millisecond.

Co-authored-by: Felix Lange <fjl@twurst.com>

* core: make txPricedList.stales the first field for 64bit alignment (#23542)

This fixes crashes on 32bit builds.

* core: 64bit alignment of testBlockChain.gasLimit (#23543)

This fixes crashes in txpool tests on 32bit platforms.

* appveyor.yml: add linux/amd64 build job (#23548)

* les: duplicate downloader and fetcher to allow progressive refactoring

* README: add londonBlock to example genesis config (#23565)

Updated example genesis.json configuration section, added londonBlock within config.

* cmd/evm: transaction validation tool (#23494)

* cmd/evm: transaction validation tool

* cmd/evm: add hash to t9n tool

* cmd/evm: lint nits

* cmd/evm: nitpicks

* core, rpc: disable memory output by default in traces (#23558)

* core: cmd: invert disableMemory

* core: fix missed inversion

* cmd/evm: preserve Flags but change default value

* Apply suggestions from code review

Co-authored-by: Martin Holst Swende <martin@swende.se>

Co-authored-by: Martin Holst Swende <martin@swende.se>

* cmd/devp2p/internal/ethtest: only use eth66 if eth66 is negotiated (#23568)

* cmd/devp2p/internal/ethtest: only use eth66 if eth66 is negotiated

* cmd/devp2p/internal/ethtest: switch on concrete type not pointer

* cmd/devp2p/internal/ethtest: switch on concrete type not pointer

* eth/tracers: abort evm execution when trace is aborted (#23580)

* core,eth: call frame tracing (#23087)


This change introduces 2 new optional methods; `enter()` and `exit()` for js tracers, and makes `step()` optiona. The two new methods are invoked when entering and exiting a call frame (but not invoked for the outermost scope, which has it's own methods). Currently these are the data fields passed to each of them:

    enter: type (opcode), from, to, input, gas, value
    exit: output, gasUsed, error

The PR also comes with a re-write of the callTracer. As a backup we keep the previous tracing script under the name `callTracerLegacy`. Behaviour of both tracers are equivalent for the most part, although there are some small differences (improvements), where the new tracer is more correct / has more information.

* ethclient, accounts/keystore: fix flaky tests (#23599)

* ethclient/gethclient: fix flaky test (due to map key ordering)

* accounts/keystore: fix test failing due to rand collision due to low time resolution on windows

* docs: fix spelling on 2021-08-22 postmortem (#23595)

Spelling update

* internal: support optional filter expression for debug.stacks (#23605)

* internal: support optional filter expression for debug.stacks

* internal/debug: fix string regexp

* internal/debug: support searching for line numbers too

* internal/debug: make gosimple linter happy

* go.mod: fix module file to prevent go from updating it during build

* console: add note about typing exit to exit (#23602)

* add explicit note about typing exit in console

* Add note about typing exit as alternative

* consensus/clique: prevent 0 len extradata from panicing (#23538)

Closes #23522

Co-authored-by: Martin Holst Swende <martin@swende.se>

* rpc: set scheme for ws and ipc conns to the server (#23615)

* rpc: set scheme for ws and ipc conns to the server

* rpc: review fixes

* rpc: bugfix

* rpc: empty default scheme

* accounts/abi: fix resolving single struct argument (#23573)

* rpc: set pong read deadline (#23556)

This PR adds a 30s timeout for the remote part to answer a ping message, thus detecting (silent) disconnnects

* cmd/puppeth: remove shh from Dockerfile (#23634)

* eth/tracers: re-write of 4byte tracer using enter/exit (#23622)

* eth/tracers: add re-write of 4byte tracer using enter/exit

* eth/tracers: fix 4byte indent

* core/state: move state account to core/types + abstracted "write account to trie" (#23567)

* core/state: abstracted "write account to trie" method

* fix appveyor build

* Apply suggestions from code review

Co-authored-by: Martin Holst Swende <martin@swende.se>

* review feedback

* core/state/accounts: move Account to core/types

* core/types: rename Account -> StateAccount

* core/state: restore EncodeRLP for stateObject

* core/types: add the missing file

* more review feedback

* more review feedback

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>

* eth/tracers: implement debug.intermediateRoots (#23594)

This PR implements a new debug method, which I've talked briefly about to some other client developers. It allows the caller to obtain the intermediate state roots for a block (which might be either a canon block or a 'bad' block).

* core/rawdb: avoid unnecessary receipt processing for log filtering (#23147)

* core/types: rm extranous check in test

* core/rawdb: add lightweight types for block logs

* core/rawdb,eth: use lightweight accessor for log filtering

* core/rawdb: add bench for decoding into rlpLogs

* accounts/abi/bind: check event signature before parsing (#23230)

* accounts/abi/bind: check event signature before parsing

* remove redundant break line

* eth/tracers: avoid unsyncronized mutations on trie database (#23632)

This PR fixes an issue in traceChain, where the statedb Commit operation was performed asynchronously with dereference-operations agains the underlying trie.Database instance. Due to how the reference counting works within the trie database (where parent count is recursively updated when new parents are added), doing dereferencing in the middle of Commit can cause the refcount to become wrong, leading to an inconsistent state. 

This was fixed by doing Commit/Deref from the same routine.

* eth/protocols/eth: simplify peer known block/txs caches (#23649)

* Simplify peer known block/txns cache

* Address minor changes

* Add more minor comments

* Minor changes from review

* graphql: add storage slots to access list (#23650)

Fixes #23640

* eth/protocols/snap, trie: better error-handling (#23657)

* params: release go-ethereum v1.10.9 stable

* params: begin v1.10.10 release cycle

* core: fix typo in comment (#23658)

* internal/ethapi: support retrieving header RLPs too

* eth/tracers: fix callTracer fault handling (#23667)

* eth/tracers: fix calltracer fault handling

* eth/tracers: fix calltracer indentation

* internal/ethapi: make header/block rlp retrieval canonical

* core/state: fix typo in comment (#23665)

* eth/filters: fix TestPendingLogsSubscription (#23619)

The test did not synchronize with per-case goroutines, and thus didn't notice
that some tests were just hanging. This change adds missing synchronization
and fixes the broken tests.

* eth/protocols/eth: replace array with counter in txn broadcaster (#23656)

* eth/api: add rpc method to obtain which states are accessible (#23646)

This PR adds a method to the debug namespace, to iterate over the blocks and check where we have the roots on disk.

* go.mod: upgrade github.com/karalable/usb (#23684)

This update includes fixes for the *BSD build and go module vendoring.

* core/types: copy tx recipient address (#23376)

This resolves a long-standing TODO. The point of copying the address is
to ensure that all data referenced by types.Transaction is independent of the
data passed into the constructor.

Co-authored-by: Felix Lange <fjl@twurst.com>

* core: improve shutdown synchronization in BlockChain (#22853)

This change removes misuses of sync.WaitGroup in BlockChain. Before this change,
block insertion modified the WaitGroup counter in order to ensure that Stop would wait
for pending operations to complete. This was racy and could even lead to crashes
if Stop was called at an unfortunate time. The issue is resolved by adding a specialized
'closable' mutex, which prevents chain modifications after stopping while also
synchronizing writers with each other.

Co-authored-by: Felix Lange <fjl@twurst.com>

* internal/ethapi: use correct signer when serving old blocks (#23683)

Fixes #23681

After the fix I get the address 0x6d6d02e83c4ced98204e20126acf27e9d87b8af2 for the
tx mentioned in the ticket, which agrees with etherscan.

* cmd/geth: fix typo in error message (#23697)

* build: upgrade -dlgo version to 1.17.2 (#23698)

Go 1.17.2 fixes some miscompilation issues on amd64 and a runtime issue with timers.
While the upgrade is not strictly necessary for go-ethereum right now, it is still good
to be up-to-date.

* eth: close miner on exit (instead of just stopping) (#21992)

This ensures that all miner goroutines have exited before stopping the blockchain. 

Co-authored-by: Felix Lange <fjl@twurst.com>

* miner: fix data race during shutdown (#23435)

This fixes a data race on worker.current by moving the call to StopPrefetcher
into the main loop.

The commit also contains fixes for two other races in unit tests of unrelated packages.

* miner/stress: initialize account backends explicitly (#23699)

node.Node no longer registers any account manager backends by default,
they need to be registered explicitly.

For ethash-based tests, we actually don't need any accounts in the miner
keystore. Just set the etherbase instead to make mining work. For
clique, the signer account must be in the keystore.

The change also adds interrupt handling in stress tests.

* internal/jsre: handle null and undefined to prevent crash (#23701)

This prevents the console from crashing when auto-completing on
a variable or property that is null or undefined.

Fixes #23693

* core/state: fix typos in comments (#23702)

* eth/gasprice: avoid modifying TestChainConfig (#23204)


Co-authored-by: Felix Lange <fjl@twurst.com>

* cmd/puppeth: add txpool to explorer Dockerfile (#23652)

* cmd/evm: stricter transaction validation (#23694)

* cmd/evm: t9n: validate transaction intrinsic gas

* cmd/evm: t9n: stricter tx validation

* build: increase C thread stack size on linux (#23676)

* build: increase thread stack size when running alpine linux

* review feedback: force a stack size of 8M on all linux distribs

* fix missing extldflags

* params: changed CatalystBlock to TerminalTotalDifficulty (#23700)

* params: changed CatalystBlock to TerminalTotalDifficulty

* eth/catalyst: comment out unused code

* les/vflux/server: fix metrics (#22946)

* les/vflux/server: fix metrics

* les/vflux/server: fix metrics

* core: tests for forked blocks retrievable by hash (#23695)

* Update tests to showcase that forked blocks can still be looked up by their hash

* ci: enable race tests as cron job on travis (#23480)

* consensus/clique, core: API cleanup (#23100)

This removes some code:

- The clique engine calculated the snapshot twice when verifying headers/blocks.

- The method GetBlockHashesFromHash in Header/Block/Lightchain was only used by tests. It
  is now removed from the API.
  
- The method GetTdByHash internally looked up the number before calling GetTd(hash, num).
  In many cases, callers already had the number, and used this method just because it has a
  shorter name. I have removed the method to make the API surface smaller.

* fixed broken web3 methods link in README.md (#23703)

* eth,rpc: allow for flag configured timeouts for eth_call (#23645)

* eth,rpc: allow for flag configured timeouts for eth_call

* lint: account for package-local import order

* cr: rename `rpc.calltimeout` to `rpc.evmtimeout`

* go.mod: upgrade goja (#23721)

This update adds support for some more ES6 functionality, notably
arrow functions.

* core/types: add MarshalBinary, UnmarshalBinary for Receipt (#22806)

* all: fix some go-critic linter warnings (#23709)

This doesn't fix all go-critic warnings, just the most serious ones.

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* accounts/abi/bind: refactor transact method (#23719)

This fixes a bug where gas-related fields of the TransactOpts passed
to transaction methods would be modified, skipping gas estimation for
subsequent transactions.

Co-authored-by: Yondon Fu <yondon.fu@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>

* core: remove unused error from TxPool.Pending (#23720)

* accounts/abi: add basic support for error types (#23161)

This is the initial step for support of Solidity errors in contract bindings.
As of this change, errors can be decoded, but are not supported in
bindings yet.

Closes #23157

* core/state/snapshot: fix data race in layer flattening (#23628)

* core/state/snapshot: fix data race in layer flattening

* core/state/snapshot: fix typo

* params: release go-ethereum v1.10.10 stable

* Apply best practices to Dockerfile

* Vendor protobuf and go extension issue PR (maticnetwork#223)

* Vendor protobuf and go extension issue PR

* Finalized the script

* Quick fix

* Final touches to Dockerfiles

* Build the new CLI

* Bump Go

* Revert "Build the new CLI"

This reverts commit e58bdfa.

* Add chain set head command (maticnetwork#226)

* Added Prometheus flag on bor-cli

* Release multi-platform with goreleaser

Packages, docker images CI automated

* Added Prometheus to New CLI: fixes

* minor Clean

* Minor Clean-up

* minor cleanup

* Added Prometheus Flag and Default

* added opentelemetry config, flags, and setup (maticnetwork#235)

* added opentelemetry config, flags, and setup

* modifications in opencollector flag and config

* bug fix

* modified error log

* Adapt Dockerfile for development (maticnetwork#237)

* Adapt Dockerfile for development

The Dockerfile for release using Alpine is in the included Dockerfile.release and this one was not used for release so doesn't make sense to have it using multistage nor Alpine.

* added service name in config and flags (maticnetwork#238)

* fix: bor receipt #1

* Write bor receipts in ancient

* fix: bor receipt rlp

* fix: testcases

* Arpit/reorg fix 2 (maticnetwork#210)

* testing

* author check

* if else fix

* Small tweeks to Dockerfiles (maticnetwork#247)

Standardize Dockerfile between projects (Heimdall) and remove not necessary tini package.

* Fix ancient receipts

* Fix ancestor bor receipts (maticnetwork#249)

* bumped version to 0.2.11

* Changed syncmode from fast to full

* Genesis change fix (maticnetwork#252)

* read from genesis file

* add: set code in finalize and assemble

* new: storing data in bor config

* chg: remove unwanted code

* chg: refactor

* minor change

* add error states

* Fix small things

* Add test

* Add more coverage in genesis finalize test

* Ensure balance is not changed

* Add decode safe check

* Change bor config block alloc field name

* Remove block alloc values in blocks

* Add genesis alloc code change info logging

Co-authored-by: Ferran Borreguero <ferranbt@protonmail.com>

* add block alloc

* change block alloc

* remove byte array

* mainnet upgrade

Co-authored-by: Paweł Bylica <chfast@gmail.com>
Co-authored-by: Fredrik Svantes <fredrik@ethereum.org>
Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
Co-authored-by: Alexander Yastrebov <yastrebov.alex@gmail.com>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: aaronbuchwald <aaron.buchwald56@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
Co-authored-by: Zachinquarantine <zachinquarantine@yahoo.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Jonathan Verhees <jonathan@verhe.es>
Co-authored-by: Pete <90942436+peteyburgers@users.noreply.github.com>
Co-authored-by: Thad Guidry <thadguidry@gmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Jordan Krage <jmank88@gmail.com>
Co-authored-by: Zachinquarantine <Zachinquarantine@protonmail.com>
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Co-authored-by: Yihau Chen <a122092487@gmail.com>
Co-authored-by: Ferran Borreguero <ferranbt@protonmail.com>
Co-authored-by: hsyodyssey <47173566+hsyodyssey@users.noreply.github.com>
Co-authored-by: Miro <mirokuratczyk@users.noreply.github.com>
Co-authored-by: Sean <darcys22@gmail.com>
Co-authored-by: Aditya Arora <arora.aditya520@gmail.com>
Co-authored-by: z89 <30657227+z89@users.noreply.github.com>
Co-authored-by: noam-alchemy <76969113+noam-alchemy@users.noreply.github.com>
Co-authored-by: Ian Norden <iannordenn@gmail.com>
Co-authored-by: Iskander (Alex) Sharipov <i.sharipov@corp.vk.com>
Co-authored-by: Yondon Fu <yondon.fu@gmail.com>
Co-authored-by: jwasinger <j-wasinger@hotmail.com>
Co-authored-by: Victor Castell <victor@victorcastell.com>
Co-authored-by: Rajat Saxena <42701222+rajatlko13@users.noreply.github.com>
Co-authored-by: Victor Castell <victor@polygon.technology>
Co-authored-by: Shivam Sharma <shivam691999@gmail.com>
Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
Co-authored-by: Sandeep Sreenath <sandeep.sreenath@gmail.com>
Co-authored-by: Jaynti Kanani <jdkanani@gmail.com>
Co-authored-by: Arpit Temani <temaniarpit27@gmail.com>
Co-authored-by: Sandeep Sreenath <ssandeep@users.noreply.github.com>
  • Loading branch information
Show file tree
Hide file tree
Showing 262 changed files with 17,178 additions and 2,531 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2.1.3
uses: actions/setup-go@v2
with:
go-version: 1.16.7
go-version: 1.17
- name: "Build binaries"
run: make all
- name: "Run tests"
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/dockerimage-latest.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/dockerimage.yml

This file was deleted.

67 changes: 0 additions & 67 deletions .github/workflows/linuxpackage.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
push:
branches-ignore:
- '**'
tags:
- 'v*.*.*'
# to be used by fork patch-releases ^^
- 'v*.*.*-*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@master
with:
go-version: 1.17.x

- name: Prepare
id: prepare
run: |
TAG=${GITHUB_REF#refs/tags/}
echo ::set-output name=tag_name::${TAG}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Run GoReleaser
run: |
make release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.prepare.outputs.tag_name }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
DOCKER_USERNAME: ${{ secrets.DOCKERHUB }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_KEY }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ profile.cov
**/yarn-error.log
./test
./bor-debug-*

dist
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file configures github.com/golangci/golangci-lint.

run:
timeout: 3m
timeout: 5m
tests: true
# default is true. Enables skipping of directories:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
Expand Down
126 changes: 126 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
project_name: bor

release:
disable: false
draft: true
prerelease: auto

builds:
- id: darwin-amd64
main: ./cmd/geth
binary: bor
goos:
- darwin
goarch:
- amd64
env:
- CC=o64-clang
- CXX=o64-clang++
ldflags:
-s -w

- id: darwin-arm64
main: ./cmd/geth
binary: bor
goos:
- darwin
goarch:
- arm64
env:
- CC=oa64-clang
- CXX=oa64-clang++
ldflags:
-s -w

- id: linux-amd64
main: ./cmd/geth
binary: bor
goos:
- linux
goarch:
- amd64
env:
- CC=gcc
- CXX=g++
ldflags:
# We need to build a static binary because we are building in a glibc based system and running in a musl container
-s -w -linkmode external -extldflags "-static"

- id: linux-arm64
main: ./cmd/geth
binary: bor
goos:
- linux
goarch:
- arm64
env:
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
ldflags:
# We need to build a static binary because we are building in a glibc based system and running in a musl container
-s -w -linkmode external -extldflags "-static"

nfpms:
- vendor: 0xPolygon
homepage: https://polygon.technology
maintainer: Polygon Team <team@polygon.technology>
description: Polygon Blockchain
license: GPLv3 LGPLv3

formats:
- apk
- deb
- rpm

contents:
- src: builder/files/bor.service
dst: /lib/systemd/system/bor.service
type: config

overrides:
rpm:
replacements:
amd64: x86_64

snapshot:
name_template: "{{ .Tag }}.next"

dockers:
- image_templates:
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-amd64
dockerfile: Dockerfile.release
use: buildx
goarch: amd64
ids:
- linux-amd64
build_flag_templates:
- --platform=linux/amd64
skip_push: true

- image_templates:
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-arm64
dockerfile: Dockerfile.release
use: buildx
goarch: arm64
ids:
- linux-arm64
build_flag_templates:
- --platform=linux/arm64
skip_push: true

docker_manifests:
- name_template: 0xpolygon/{{ .ProjectName }}:{{ .Version }}
image_templates:
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-amd64
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-arm64

- name_template: 0xpolygon/{{ .ProjectName }}:latest
image_templates:
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-amd64
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-arm64

announce:
slack:
enabled: true
# The name of the channel that the user selected as a destination for webhook messages.
channel: '#code-releases'
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,15 @@ jobs:
submodules: false # avoid cloning ethereum/tests
script:
- go run build/ci.go purge -store gethstore/builds -days 14

# This builder executes race tests
- stage: build
if: type = cron
os: linux
dist: bionic
go: 1.17.x
env:
- GO111MODULE=on
script:
- go run build/ci.go test -race -coverage $TEST_PACKAGES

25 changes: 12 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# Build Geth in a stock Go builder container
FROM golang:1.17-alpine as builder
FROM golang:latest

RUN apk add --no-cache make gcc musl-dev linux-headers git bash
ARG BOR_DIR=/bor
ENV BOR_DIR=$BOR_DIR

ADD . /bor
RUN cd /bor && make bor-all
RUN apt-get update -y && apt-get upgrade -y \
&& apt install build-essential git -y \
&& mkdir -p /bor

CMD ["/bin/bash"]
WORKDIR ${BOR_DIR}
COPY . .
RUN make bor-all

# Pull Bor into a second stage deploy alpine container
FROM alpine:latest
ENV SHELL /bin/bash
EXPOSE 8545 8546 8547 30303 30303/udp

RUN apk add --no-cache ca-certificates
COPY --from=builder /bor/build/bin/bor /usr/local/bin/
COPY --from=builder /bor/build/bin/bootnode /usr/local/bin/

EXPOSE 8545 8546 8547 30303 30303/udp
ENTRYPOINT ["bor"]
7 changes: 5 additions & 2 deletions Dockerfile.alltools
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ RUN cd /bor && make bor-all
# Pull all binaries into a second stage deploy alpine container
FROM alpine:latest

RUN apk add --no-cache ca-certificates
RUN set -x \
&& apk add --update --no-cache \
ca-certificates \
&& rm -rf /var/cache/apk/*
COPY --from=builder /bor/build/bin/* /usr/local/bin/

EXPOSE 8545 8546 30303 30303/udp
EXPOSE 8545 8546 30303 30303/udp
7 changes: 7 additions & 0 deletions Dockerfile.release
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM alpine:3.14

RUN apk add --no-cache ca-certificates
COPY bor /usr/local/bin/

EXPOSE 8545 8546 8547 30303 30303/udp
ENTRYPOINT ["bor"]
Loading

0 comments on commit 74366b0

Please sign in to comment.