Skip to content

Commit e7e3fa5

Browse files
authored
Merge branch 'master' into feature/go-native-trace
2 parents ac8da4f + a0df3fb commit e7e3fa5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+5294
-3003
lines changed

.circleci/config.yml

+67-55
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ end-to-end-test: &end-to-end-test
262262
no_output_timeout: 15m
263263
command: |
264264
export PATH=${PATH}:~/repos/golang/go/bin
265+
export E2E_TESTS_FORCE_USE_MYCELO=true
265266
cd celo-monorepo/packages/celotool
266267
./${TEST_NAME} local ~/repos/geth
267268
# Note, all e2e tests call 'make all' in ~/repos/geth, this causes most code
@@ -278,6 +279,34 @@ jobs:
278279
- run: go mod download
279280
- *save-go-mod-cache
280281

282+
akeyless-get-token:
283+
docker:
284+
- image: akeyless/ci_base
285+
environment:
286+
PR_WRITE_TOKEN_PATH: /dynamic-secrets/keys/github/celo-blockchain/pull_requests=write
287+
steps:
288+
- checkout
289+
- run:
290+
name: "update akeyless cli tool to latest version"
291+
command: akeyless update
292+
293+
- run:
294+
name: "authenticate to akeyless via OIDC"
295+
command: akeyless auth --access-id $accessid --access-type jwt --jwt $CIRCLE_OIDC_TOKEN --json | jq '.token' -r > ~/.vault_token
296+
297+
- run:
298+
name: "Get PR Comment token (and remove unnecessary information and punctuation)"
299+
command: TOKEN=$(cat ~/.vault_token) && echo export PR_COMMENT_TOKEN2=$(akeyless get-dynamic-secret-value --name $PR_WRITE_TOKEN_PATH --token $TOKEN |grep token | awk '{print $2}' | tr -d '"",' ) >> "$BASH_ENV"
300+
301+
- run:
302+
name: "Copy $BASH_ENV to bash.env file so we can persist that to workspaces"
303+
command: cp $BASH_ENV bash.env
304+
305+
- persist_to_workspace:
306+
root: .
307+
paths:
308+
- bash.env
309+
281310
prepare-system-contracts:
282311
parameters:
283312
cache-key:
@@ -376,6 +405,11 @@ jobs:
376405
go run tools/parsecov/main.go -packagePrefix github.com/celo-org/celo-blockchain/ cov.out > summary
377406
cat summary
378407
408+
- attach_workspace:
409+
at: .
410+
- run: |
411+
cat bash.env > $BASH_ENV
412+
379413
- run:
380414
name: Post summary comment on PR
381415
command: |
@@ -435,7 +469,8 @@ jobs:
435469
# replaced by '\n'. Using backtics causes there to be a round of
436470
# backslash processing on the command before execution, so we
437471
# need to double the backslashes in the awk command.
438-
curl -u piersy:${PR_COMMENT_TOKEN} -X ${CURL_VERB} $URL -d "{\"body\":\"`awk -v ORS='\\\\n' '1' comment`\"}" ;
472+
curl -u celo-org:${PR_COMMENT_TOKEN2} -X ${CURL_VERB} $URL -d "{\"body\":\"`awk -v ORS='\\\\n' '1' comment`\"}" ;
473+
439474
440475
e2e-benchmarks:
441476
executor: golang
@@ -499,40 +534,31 @@ jobs:
499534
# paths:
500535
# - geth/build/bin/geth.aar
501536

502-
ios:
503-
macos:
504-
xcode: "12.5.1"
505-
working_directory: ~/repos/geth
506-
steps:
507-
# Note the macos executor does not seem to be able to restore caches.
508-
- *shallow-checkout
509-
- run:
510-
name: Setup Go language
511-
command: |
512-
brew install [email protected]
513-
514-
# Check that homebrew installed the expected go version
515-
if [[ "$(go version)" != "go version go1.16"* ]]; then
516-
echo "go1.16 is required"
517-
exit 1
518-
fi
519-
- run:
520-
name: Compile ios client
521-
command: make ios
522-
- persist_to_workspace:
523-
root: ~/repos
524-
paths:
525-
- geth/build/bin/Geth.framework.tgz
526-
- geth/libbls_snark_sys.a
527-
528-
publish-mobile-client:
529-
docker:
530-
- image: circleci/node:10
531-
working_directory: ~/repos/geth
532-
steps:
533-
- attach_workspace:
534-
at: ~/repos
535-
- run: ./scripts/publish-mobile-client.sh ${CIRCLE_SHA1} ${NPM_TOKEN_FOR_CELO_CLIENT}
537+
# ios:
538+
# macos:
539+
# xcode: "12.5.1"
540+
# working_directory: ~/repos/geth
541+
# steps:
542+
# # Note the macos executor does not seem to be able to restore caches.
543+
# - *shallow-checkout
544+
# - run:
545+
# name: Setup Go language
546+
# command: |
547+
# brew install [email protected]
548+
# brew link [email protected]
549+
# # Check that homebrew installed the expected go version
550+
# if [[ "$(go version)" != "go version go1.16"* ]]; then
551+
# echo "go1.16 is required"
552+
# exit 1
553+
# fi
554+
# - run:
555+
# name: Compile ios client
556+
# command: make ios
557+
# - persist_to_workspace:
558+
# root: ~/repos
559+
# paths:
560+
# - geth/build/bin/Geth.framework.tgz
561+
# - geth/libbls_snark_sys.a
536562

537563
lightest-sync-test:
538564
executor: golang
@@ -623,34 +649,20 @@ workflows:
623649
requires:
624650
- go-modules
625651
- prepare-system-contracts
652+
- akeyless-get-token:
653+
context:
654+
- akeyless
626655
- istanbul-e2e-coverage:
627656
requires:
628657
- go-modules
629658
- prepare-system-contracts
659+
- akeyless-get-token
630660
- e2e-benchmarks:
631661
requires:
632662
- go-modules
633663
- prepare-system-contracts
634-
#- android
635-
- ios
636-
- publish-mobile-client:
637-
requires:
638-
#- android
639-
- ios
640-
# Makes sure tests are all green before publishing
641-
# Though these are not using the mobile built binaries
642-
# they should be a good indicator
643-
- unit-tests
644-
- lightest-sync-test
645-
- end-to-end-blockchain-parameters-test
646-
- end-to-end-governance-test
647-
- end-to-end-slashing-test
648-
- end-to-end-sync-test
649-
- end-to-end-transfer-test
650-
- end-to-end-validator-order-test
651-
filters:
652-
branches:
653-
only: master
664+
# - android
665+
# - ios
654666
- lightest-sync-test:
655667
requires:
656668
- go-modules

.github/ISSUE_TEMPLATE/chore.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Simple Task
33
about: Simple Actionable Task
44
title: ''
5-
labels: blockchain
5+
labels: triage
66
assignees: ''
77

88
---

.github/ISSUE_TEMPLATE/design_task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Research/Design Task
33
about: Research of design task
44
title: ''
5-
labels: blockchain, needs-research
5+
labels: triage, needs-research
66
assignees: ''
77

88
---

.github/ISSUE_TEMPLATE/feature.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Request a feature
33
about: Report a missing feature - e.g. as a step before submitting a PR
44
title: ''
5-
labels: 'type:feature'
5+
labels: triage, 'type:feature'
66
assignees: ''
77
---
88

@@ -14,4 +14,4 @@ What are the use-cases?
1414
# Implementation
1515

1616
Do you have ideas regarding the implementation of this feature?
17-
Are you willing to implement this feature?
17+
Are you willing to implement this feature?

.github/ISSUE_TEMPLATE/issue.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Issue
33
about: Feature/Need/Problem complete template
44
title: ''
5-
labels: blockchain, needs-research
5+
labels: triage, needs-research
66
assignees: ''
77

88
---

.github/ISSUE_TEMPLATE/question.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Ask a question
33
about: Something is unclear
44
title: ''
5-
labels: 'type:docs'
5+
labels: triage, 'type:docs'
66
assignees: ''
77
---
88

CeloBlockchain.podspec

-16
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Official golang implementation of the Celo blockchain, based off of the [officia
66
[![Codecov](https://img.shields.io/codecov/c/github/celo-org/celo-blockchain)](https://codecov.io/gh/celo-org/celo-blockchain)
77
[![Discord](https://img.shields.io/badge/discord-join%20chat-blue.svg)](https://chat.celo.org)
88

9-
Prebuilt [Docker](https://en.wikipedia.org/wiki/Docker_\(software\)) images are available for immediate use: [us.gcr.io/celo-testnet/celo-node](https://us.gcr.io/celo-testnet/celo-node). See [docs.celo.org/getting-started](https://docs.celo.org/getting-started/choosing-a-network) for a guide to the Celo networks and how to get started.
9+
Prebuilt [Docker](https://en.wikipedia.org/wiki/Docker_\(software\)) images are available for immediate use: [us.gcr.io/celo-org/geth](https://us.gcr.io/celo-org/geth). See [docs.celo.org/getting-started](https://docs.celo.org/getting-started/choosing-a-network) for a guide to the Celo networks and how to get started.
1010

1111
Documentation for Celo more generally can be found at [docs.celo.org](https://docs.celo.org/)
1212

build/ci.go

-1
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,6 @@ func xgoAllToolsArchiveFiles(target string, dir string) []string {
13421342
executableXgoPath("evm", target, dir),
13431343
executableXgoPath("geth", target, dir),
13441344
executableXgoPath("rlpdump", target, dir),
1345-
executableXgoPath("wnode", target, dir),
13461345
executableXgoPath("clef", target, dir),
13471346
executableXgoPath("blspopchecker", target, dir),
13481347
}

cmd/utils/flags.go

+13-9
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,10 @@ var (
191191
Value: 0,
192192
}
193193
defaultSyncMode = ethconfig.Defaults.SyncMode
194-
SyncModeFlag = TextMarshalerFlag{
194+
// TODO: Check if snap sync is enabled
195+
SyncModeFlag = TextMarshalerFlag{
195196
Name: "syncmode",
196-
Usage: `Blockchain sync mode ("fast", "full", "snap", "light", or "lightest")`,
197+
Usage: `Blockchain sync mode ("fast", "full", "light", or "lightest")`,
197198
Value: &defaultSyncMode,
198199
}
199200
GCModeFlag = cli.StringFlag{
@@ -1732,13 +1733,16 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
17321733
cfg.SnapshotCache = ctx.GlobalInt(CacheFlag.Name) * ctx.GlobalInt(CacheSnapshotFlag.Name) / 100
17331734
}
17341735
if !ctx.GlobalBool(SnapshotFlag.Name) {
1735-
// If snap-sync is requested, this flag is also required
1736-
if cfg.SyncMode == downloader.SnapSync {
1737-
log.Info("Snap sync requested, enabling --snapshot")
1738-
} else {
1739-
cfg.TrieCleanCache += cfg.SnapshotCache
1740-
cfg.SnapshotCache = 0 // Disabled
1741-
}
1736+
// Snap Dync Disabled. See https://github.com/celo-org/celo-blockchain/issues/1735
1737+
// // If snap-sync is requested, this flag is also required
1738+
// if cfg.SyncMode == downloader.SnapSync {
1739+
// log.Info("Snap sync requested, enabling --snapshot")
1740+
// } else {
1741+
// cfg.TrieCleanCache += cfg.SnapshotCache
1742+
// cfg.SnapshotCache = 0 // Disabled
1743+
// }
1744+
cfg.TrieCleanCache += cfg.SnapshotCache
1745+
cfg.SnapshotCache = 0 // Disabled
17421746
}
17431747
if ctx.GlobalIsSet(DocRootFlag.Name) {
17441748
cfg.DocRoot = ctx.GlobalString(DocRootFlag.Name)

consensus/istanbul/celo-ibft-spec.md

+26
Original file line numberDiff line numberDiff line change
@@ -448,3 +448,29 @@ function call to occur after the given duration.
448448
// to Hc and value equal to V is greater than 1 and less than 10.
449449
1 < |{ m<Prepare, Hc, Rm, Vm> ∈ M : Rm = Hc && Vm = V }| < 10
450450
```
451+
452+
## Appendix 2: Notes
453+
454+
### What do the prepared certificate and round change certificate do?
455+
456+
They enforce that if it’s possible that a node could have confirmed a block in
457+
a round, then all remaining nodes in future rounds can only confirm the same
458+
block.
459+
460+
- A node could have confirmed a block if 2f+1 nodes send commit messages for a
461+
block.
462+
- If a node sends a commit message for a block then it must have seen 2f+1
463+
prepares or commits for that block and therefore must have a prepared
464+
certificate.
465+
- Therefore there must be at least 2f+1 nodes with prepared certificates for a
466+
block if 2f+1 nodes have sent commit messages for a block.
467+
- When the proposer proposes in the next round they must provide a round change
468+
certificate with 2f+1 round change messages.
469+
- When nodes send round change messages they should include the prepared
470+
certificate if they have one.
471+
- So if 2f+1 nodes have prepared certificates then f nodes do not.
472+
- If the proposer of the next round includes the f round change messages from
473+
the nodes that do not have prepared certificates, and if there are a further
474+
f byzantine nodes that do not include their prepared certificate even if they
475+
had one, there still remains one round change message that must come from a
476+
non byzantine node and must include a prepared certificate.

consensus/istanbul/core/core.go

-5
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,6 @@ type core struct {
152152

153153
// New creates an Istanbul consensus core
154154
func New(backend CoreBackend, config *istanbul.Config) Engine {
155-
rsdb, err := newRoundStateDB(config.RoundStateDBPath, nil)
156-
if err != nil {
157-
log.Crit("Failed to open RoundStateDB", "err", err)
158-
}
159155

160156
c := &core{
161157
config: config,
@@ -167,7 +163,6 @@ func New(backend CoreBackend, config *istanbul.Config) Engine {
167163
pendingRequests: prque.New(nil),
168164
pendingRequestsMu: new(sync.Mutex),
169165
consensusTimestamp: time.Time{},
170-
rsdb: rsdb,
171166
consensusPrepareTimeGauge: metrics.NewRegisteredGauge("consensus/istanbul/core/consensus_prepare", nil),
172167
consensusCommitTimeGauge: metrics.NewRegisteredGauge("consensus/istanbul/core/consensus_commit", nil),
173168
verifyGauge: metrics.NewRegisteredGauge("consensus/istanbul/core/verify", nil),

consensus/istanbul/core/handler.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@ import (
2222
"github.com/celo-org/celo-blockchain/common"
2323
"github.com/celo-org/celo-blockchain/common/hexutil"
2424
"github.com/celo-org/celo-blockchain/consensus/istanbul"
25+
"github.com/celo-org/celo-blockchain/log"
2526
)
2627

2728
// Start implements core.Engine.Start
2829
func (c *core) Start() error {
29-
30+
rsdb, err := newRoundStateDB(c.config.RoundStateDBPath, nil)
31+
if err != nil {
32+
log.Crit("Failed to open RoundStateDB", "err", err)
33+
}
34+
c.rsdb = rsdb
3035
roundState, err := c.createRoundState()
3136
if err != nil {
3237
return err
@@ -63,10 +68,11 @@ func (c *core) Stop() error {
6368
// Make sure the handler goroutine exits
6469
c.handlerWg.Wait()
6570

71+
err := c.rsdb.Close()
6672
c.currentMu.Lock()
6773
defer c.currentMu.Unlock()
6874
c.current = nil
69-
return nil
75+
return err
7076
}
7177

7278
// ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)