Skip to content

Commit

Permalink
Merge pull request #2 from maticnetwork/develop
Browse files Browse the repository at this point in the history
Merging upstream
  • Loading branch information
PekopT authored Apr 30, 2023
2 parents 9880d75 + 3607151 commit f3a81c7
Show file tree
Hide file tree
Showing 117 changed files with 4,397 additions and 654 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ labels: 'type:bug'
assignees: ''
---

Our support team has aggregated some common issues and their solutions from past which are faced while running or interacting with a bor client. In order to prevent redundant efforts, we would encourage you to have a look at the [FAQ's section](https://docs.polygon.technology/docs/faq/technical-faqs) of our documentation mentioning the same, before filing an issue here. In case of additional support, you can also join our [discord](https://discord.com/invite/zdwkdvMNY2) server
Our support team has aggregated some common issues and their solutions from past which are faced while running or interacting with a bor client. In order to prevent redundant efforts, we would encourage you to have a look at the [FAQ's section](https://wiki.polygon.technology/docs/faq/technical-faqs/) of our documentation mentioning the same, before filing an issue here. In case of additional support, you can also join our [discord](https://discord.com/invite/zdwkdvMNY2) server

<!--
NOTE: Please make sure to check of any addresses / private keys / rpc url's / IP's before sharing the logs or anything from the additional information section (start.sh or heimdall config).
Expand Down
238 changes: 230 additions & 8 deletions .github/workflows/packager.yml

Large diffs are not rendered by default.

29 changes: 3 additions & 26 deletions .github/workflows/security-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ jobs:
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
GOFLAGS: "-buildvcs=false"
with:
args: --org=${{ secrets.SNYK_ORG }} --severity-threshold=medium --sarif-file-output=snyk.sarif
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v2
continue-on-error: true
with:
sarif_file: snyk.sarif

Expand All @@ -37,6 +39,7 @@ jobs:
command: code test
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v2
continue-on-error: true
with:
sarif_file: snyk.sarif

Expand All @@ -62,29 +65,3 @@ jobs:
with:
name: raw-report
path: raw-report.json

sonarqube:
name: SonarQube
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting.
fetch-depth: 0

# Triggering SonarQube analysis as results of it are required by Quality Gate check.
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

# Check the Quality Gate status.
- name: SonarQube Quality Gate check
id: sonarqube-quality-gate-check
uses: sonarsource/sonarqube-quality-gate-action@master
# Force to fail step after specific time.
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
32 changes: 32 additions & 0 deletions .github/workflows/security-sonarqube-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: SonarQube CI
on:
push:
branches:
- develop

jobs:
sonarqube:
name: SonarQube
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting.
fetch-depth: 0

# Triggering SonarQube analysis as results of it are required by Quality Gate check.
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

# Check the Quality Gate status.
- name: SonarQube Quality Gate check
id: sonarqube-quality-gate-check
uses: sonarsource/sonarqube-quality-gate-action@master
# Force to fail step after specific time.
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,18 @@ GORUN = env GO111MODULE=on go run
GOPATH = $(shell go env GOPATH)

GIT_COMMIT ?= $(shell git rev-list -1 HEAD)
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
GIT_TAG ?= $(shell git describe --tags `git rev-list --tags="v*" --max-count=1`)

PACKAGE = github.com/ethereum/go-ethereum
GO_FLAGS += -buildvcs=false
GO_FLAGS += -ldflags "-X ${PACKAGE}/params.GitCommit=${GIT_COMMIT} -X ${PACKAGE}/params.GitBranch=${GIT_BRANCH} -X ${PACKAGE}/params.GitTag=${GIT_TAG}"
GO_LDFLAGS += -ldflags "-X ${PACKAGE}/params.GitCommit=${GIT_COMMIT}"

TESTALL = $$(go list ./... | grep -v go-ethereum/cmd/)
TESTE2E = ./tests/...
GOTEST = GODEBUG=cgocheck=0 go test $(GO_FLAGS) -p 1
GOTEST = GODEBUG=cgocheck=0 go test $(GO_FLAGS) $(GO_LDFLAGS) -p 1

bor:
mkdir -p $(GOPATH)/bin/
go build -o $(GOBIN)/bor ./cmd/cli/main.go
go build -o $(GOBIN)/bor $(GO_LDFLAGS) ./cmd/cli/main.go
cp $(GOBIN)/bor $(GOPATH)/bin/
@echo "Done building."

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ them using your favourite package manager. Once the dependencies are installed,
2. Commit and prepare for pull request (PR). In your PR commit message, reference the issue it resolves (see [how to link a commit message to an issue using a keyword](https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword).
Checkout our [Git-Rules](https://docs.polygon.technology/docs/contribute/orientation#git-rules)
Checkout our [Git-Rules](https://wiki.polygon.technology/docs/contribute/orientation/#git-rules)
```
$ git commit -m "brief description of changes [Fixes #1234]"
Expand Down
43 changes: 39 additions & 4 deletions builder/files/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,38 @@

chain = "mainnet"
# chain = "mumbai"
# identity = "Pratiks-MacBook-Pro.local"
# log-level = "INFO"
# identity = "Annon-Identity"
# verbosity = 3
# vmdebug = false
datadir = "/var/lib/bor/data"
# ancient = ""
# keystore = "/var/lib/bor/keystore"
# "rpc.batchlimit" = 100
# "rpc.returndatalimit" = 100000
syncmode = "full"
# gcmode = "full"
# snapshot = true
# "bor.logs" = false
# ethstats = ""

# devfakeauthor = false
# ["eth.requiredblocks"]

# [log]
# vmodule = ""
# json = false
# backtrace = ""
# debug = true

[p2p]
# maxpeers = 1
# nodiscover = true
# maxpendpeers = 50
# bind = "0.0.0.0"
# port = 30303
# nat = "any"
# netrestrict = ""
# nodekey = ""
# nodekeyhex = ""
[p2p.discovery]
# v5disc = false
bootnodes = ["enode://0cb82b395094ee4a2915e9714894627de9ed8498fb881cec6db7c65e8b9a5bd7f2f25cc84e71e89d0947e51c76e85d0847de848c7782b13c0255247a6758178c@44.232.55.71:30303", "enode://88116f4295f5a31538ae409e4d44ad40d22e44ee9342869e7d68bdec55b0f83c1530355ce8b41fbec0928a7d75a5745d528450d30aec92066ab6ba1ee351d710@159.203.9.164:30303"]
Expand Down Expand Up @@ -58,13 +70,16 @@ syncmode = "full"
# mine = true
# etherbase = "VALIDATOR ADDRESS"
# extradata = ""
# recommit = "2m5s"


# [jsonrpc]
# ipcdisable = false
# ipcpath = ""
# gascap = 50000000
# evmtimeout = "5s"
# txfeecap = 5.0
# allow-unprotected-txs = false
# [jsonrpc.http]
# enabled = false
# port = 8545
Expand All @@ -73,28 +88,39 @@ syncmode = "full"
# api = ["eth", "net", "web3", "txpool", "bor"]
# vhosts = ["*"]
# corsdomain = ["*"]
# ep-size = 40
# ep-requesttimeout = "0s"
# [jsonrpc.ws]
# enabled = false
# port = 8546
# prefix = ""
# host = "localhost"
# api = ["web3", "net"]
# origins = ["*"]
# ep-size = 40
# ep-requesttimeout = "0s"
# [jsonrpc.graphql]
# enabled = false
# port = 0
# prefix = ""
# host = ""
# vhosts = ["*"]
# corsdomain = ["*"]
# [jsonrpc.auth]
# jwtsecret = ""
# addr = "localhost"
# port = 8551
# vhosts = ["localhost"]
# [jsonrpc.timeouts]
# read = "30s"
# read = "10s"
# write = "30s"
# idle = "2m0s"

[gpo]
# blocks = 20
# percentile = 60
# maxheaderhistory = 1024
# maxblockhistory = 1024
# maxprice = "5000000000000"
ignoreprice = "30000000000"

Expand Down Expand Up @@ -128,6 +154,7 @@ syncmode = "full"
# txlookuplimit = 2350000
# triesinmemory = 128
# timeout = "1h0m0s"
# fdlimit = 0

[accounts]
# allow-insecure-unlock = true
Expand All @@ -142,3 +169,11 @@ syncmode = "full"
# [developer]
# dev = false
# period = 0
# gaslimit = 11500000

# [pprof]
# pprof = false
# port = 6060
# addr = "127.0.0.1"
# memprofilerate = 524288
# blockprofilerate = 0
2 changes: 1 addition & 1 deletion cmd/clef/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ func signer(c *cli.Context) error {
vhosts := utils.SplitAndTrim(c.GlobalString(utils.HTTPVirtualHostsFlag.Name))
cors := utils.SplitAndTrim(c.GlobalString(utils.HTTPCORSDomainFlag.Name))

srv := rpc.NewServer()
srv := rpc.NewServer(0, 0)
err := node.RegisterApis(rpcAPI, []string{"account"}, srv, false)
if err != nil {
utils.Fatalf("Could not register API: %w", err)
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ The dumpgenesis command dumps the genesis block configuration in JSON format to
utils.HeimdallgRPCAddressFlag,
utils.RunHeimdallFlag,
utils.RunHeimdallArgsFlag,
utils.UseHeimdallAppFlag,
},
Category: "BLOCKCHAIN COMMANDS",
Description: `
Expand Down
8 changes: 4 additions & 4 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,6 @@ func geth(ctx *cli.Context) error {
return fmt.Errorf("invalid command: %q", args[0])
}

prepare(ctx)
stack, backend := makeFullNode(ctx)
defer stack.Close()

if ctx.GlobalBool(utils.RunHeimdallFlag.Name) {
shutdownCtx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGINT, syscall.SIGTERM)
defer stop()
Expand All @@ -360,6 +356,10 @@ func geth(ctx *cli.Context) error {
}()
}

prepare(ctx)
stack, backend := makeFullNode(ctx)
defer stack.Close()

startNode(ctx, stack, backend, false)
stack.Wait()
return nil
Expand Down
8 changes: 8 additions & 0 deletions cmd/utils/bor_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,20 @@ var (
Value: "",
}

// UseHeimdallApp flag for using internall heimdall app to fetch data
UseHeimdallAppFlag = cli.BoolFlag{
Name: "bor.useheimdallapp",
Usage: "Use child heimdall process to fetch data, Only works when bor.runheimdall is true",
}

// BorFlags all bor related flags
BorFlags = []cli.Flag{
HeimdallURLFlag,
WithoutHeimdallFlag,
HeimdallgRPCAddressFlag,
RunHeimdallFlag,
RunHeimdallArgsFlag,
UseHeimdallAppFlag,
}
)

Expand All @@ -82,6 +89,7 @@ func SetBorConfig(ctx *cli.Context, cfg *eth.Config) {
cfg.HeimdallgRPCAddress = ctx.GlobalString(HeimdallgRPCAddressFlag.Name)
cfg.RunHeimdall = ctx.GlobalBool(RunHeimdallFlag.Name)
cfg.RunHeimdallArgs = ctx.GlobalString(RunHeimdallArgsFlag.Name)
cfg.UseHeimdallApp = ctx.GlobalBool(UseHeimdallAppFlag.Name)
}

// CreateBorEthereum Creates bor ethereum object from eth.Config
Expand Down
1 change: 1 addition & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -2037,6 +2037,7 @@ func MakeChain(ctx *cli.Context, stack *node.Node) (chain *core.BlockChain, chai
HeimdallgRPCAddress: ctx.GlobalString(HeimdallgRPCAddressFlag.Name),
RunHeimdall: ctx.GlobalBool(RunHeimdallFlag.Name),
RunHeimdallArgs: ctx.GlobalString(RunHeimdallArgsFlag.Name),
UseHeimdallApp: ctx.GlobalBool(UseHeimdallAppFlag.Name),
})
engine = ethereum.Engine()
} else {
Expand Down
Loading

0 comments on commit f3a81c7

Please sign in to comment.