Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Epic/pandora consensus #58

Draft
wants to merge 233 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
233 commits
Select commit Hold shift + click to select a range
456f32c
Marked things that needs to be changed to make pandora engine working…
blazejkrzak Mar 5, 2021
d9c78b5
Attempt to run pandora with mocked vanguard
blazejkrzak Mar 5, 2021
ee4453a
Lru cache have its own problem
blazejkrzak Mar 5, 2021
894d17a
- modified lru in ethash test;
mxmar Mar 5, 2021
bd36400
- added test for submission;
mxmar Mar 8, 2021
d3e7b99
Introduced Pandora mode to Seal engine
blazejkrzak Mar 8, 2021
f621e3a
Prepared header is pushed via request to remote signer
blazejkrzak Mar 8, 2021
9db666e
Removed test that was redundant
blazejkrzak Mar 8, 2021
f57016a
Some codestyle
blazejkrzak Mar 8, 2021
0597a07
Get back to being compatible with len of the remote sealer channels
blazejkrzak Mar 8, 2021
d89c867
Test is written that could match pandora execution flow, but API retu…
blazejkrzak Mar 8, 2021
1b4d1e9
Test is written that could match pandora execution flow, but API retu…
blazejkrzak Mar 8, 2021
40841e1
Added proper comment for makeWork
blazejkrzak Mar 8, 2021
f769bd9
Whole process of checking signature works from mixDigest channel
blazejkrzak Mar 10, 2021
f2746c0
typeo
blazejkrzak Mar 10, 2021
17401d5
quick removal of todos
blazejkrzak Mar 13, 2021
8d0a2d3
WIP: Trying to do minimal pandora execution engine. Try to retrieve v…
blazejkrzak Mar 13, 2021
7abc851
WIP: Added verification process to ethash
blazejkrzak Mar 14, 2021
3ffec9b
WIP: Added verification process to ethash
blazejkrzak Mar 14, 2021
52e0a59
WIP: sealing and verifying with tests
blazejkrzak Mar 15, 2021
b7e30c9
WIP: sealing and verifying with tests
blazejkrzak Mar 15, 2021
8c33550
WIP: sealing and verifying with tests
blazejkrzak Mar 15, 2021
148fddf
WIP: sealing and verifying with tests
blazejkrzak Mar 15, 2021
5588279
WIP: sealing and verifying with tests
blazejkrzak Mar 15, 2021
98517d7
WIP: sealing and verifying with tests
blazejkrzak Mar 15, 2021
c49ed1c
WIP: sealing and verifying with tests
blazejkrzak Mar 15, 2021
5a3fa42
WIP: sealing and verifying with tests
blazejkrzak Mar 15, 2021
542f5c4
WIP: sealing and verifying with tests
blazejkrzak Mar 15, 2021
a1b3653
WIP: sealing and verifying with tests
blazejkrzak Mar 15, 2021
6ded14d
WIP: some weird state
blazejkrzak Mar 15, 2021
8f08e69
WIP:
blazejkrzak Mar 15, 2021
7c15224
WIP:
blazejkrzak Mar 15, 2021
2201f5f
WIP:
blazejkrzak Mar 15, 2021
87aed96
WIP:
blazejkrzak Mar 19, 2021
f744b70
WIP:
blazejkrzak Mar 19, 2021
433282d
WIP:
blazejkrzak Mar 19, 2021
6eeb797
WIP:
blazejkrzak Mar 19, 2021
8fe58b2
WIP:
blazejkrzak Mar 19, 2021
2aa435a
WIP:
blazejkrzak Mar 19, 2021
3851682
WIP:
blazejkrzak Mar 22, 2021
bdf682e
WIP:
blazejkrzak Mar 22, 2021
3c6b586
WIP:
blazejkrzak Mar 22, 2021
24e72f5
WIP:
blazejkrzak Mar 22, 2021
e0b55c9
WIP:
blazejkrzak Mar 22, 2021
b121a72
WIP:
blazejkrzak Mar 22, 2021
53c12b9
WIP:
blazejkrzak Mar 22, 2021
7630bc2
WIP: change to signature inserted into header ExtraData instead of Mi…
blazejkrzak Mar 25, 2021
676c58d
WIP: change to signature inserted into header ExtraData instead of Mi…
blazejkrzak Mar 25, 2021
4aab528
WIP: change to signature inserted into header ExtraData instead of Mi…
blazejkrzak Mar 25, 2021
7789626
WIP: change to signature inserted into header ExtraData instead of Mi…
blazejkrzak Mar 25, 2021
0cb8d91
WIP: change to signature inserted into header ExtraData instead of Mi…
blazejkrzak Mar 25, 2021
980b4ef
WIP: change to signature inserted into header ExtraData instead of Mi…
blazejkrzak Mar 25, 2021
887e082
I just commit it. SubmitWork does not work as expected.
blazejkrzak Mar 25, 2021
b03b202
stress test work, but I have removed hex from submitWork. Header crea…
blazejkrzak Mar 26, 2021
a77d6bd
Feature: 45 pandora execution engine:
mxmar Mar 29, 2021
4a59b7c
Feature: 45 pandora execution engine:
mxmar Mar 29, 2021
db0c71d
Feature: 45 pandora execution engine:
mxmar Mar 29, 2021
a81f3d3
Feature: 45 pandora execution engine:
mxmar Mar 29, 2021
6dbee8e
Feature: 45 pandora execution engine:
mxmar Mar 29, 2021
a128545
Feature: 45 pandora execution engine:
mxmar Mar 29, 2021
928f35b
WIP: Pandora execution engine
blazejkrzak Mar 29, 2021
c0f36a6
WIP: Pandora execution engine
blazejkrzak Mar 29, 2021
7720177
WIP: Pandora execution engine
blazejkrzak Mar 29, 2021
4858271
WIP: Pandora execution engine
blazejkrzak Mar 29, 2021
d66b236
WIP: Pandora execution engine
blazejkrzak Mar 29, 2021
394a87b
WIP: Pandora execution engine
blazejkrzak Mar 29, 2021
39687a4
WIP: Pandora execution engine
blazejkrzak Mar 29, 2021
cd8bc8a
WIP: Pandora execution engine
blazejkrzak Apr 6, 2021
c7cdaa7
WIP: Pandora execution engine
blazejkrzak Apr 6, 2021
bc92fde
WIP: Pandora execution engine
blazejkrzak Apr 6, 2021
cdc8c00
WIP: Pandora execution engine
blazejkrzak Apr 7, 2021
948ad28
WIP: Pandora execution engine
blazejkrzak Apr 7, 2021
9e2e109
WIP: Pandora execution engine
blazejkrzak Apr 7, 2021
7e73c09
WIP: Pandora execution engine
blazejkrzak Apr 8, 2021
ceb2727
WIP: Pandora execution engine
blazejkrzak Apr 8, 2021
8a75961
WIP: Pandora execution engine
blazejkrzak Apr 8, 2021
88a199d
WIP: Pandora execution engine
blazejkrzak Apr 9, 2021
6c113ae
WIP: Pandora execution engine
blazejkrzak Apr 9, 2021
6a9e12d
WIP: Subscription to minimalConsensus
blazejkrzak Apr 14, 2021
75e6518
WIP: Subscription to minimalConsensus
blazejkrzak Apr 14, 2021
23c6012
WIP: Subscription to minimalConsensus
blazejkrzak Apr 14, 2021
5c5391f
WIP: Subscription to minimalConsensus
blazejkrzak Apr 14, 2021
44621ca
WIP: Subscription to minimalConsensus
blazejkrzak Apr 14, 2021
ea60c47
WIP: Subscription to minimalConsensus
blazejkrzak Apr 15, 2021
0770cef
WIP: Subscription to minimalConsensus
blazejkrzak Apr 15, 2021
d7c7a7f
WIP: Subscription to minimalConsensus
blazejkrzak Apr 15, 2021
f58afd0
WIP: Subscription to minimalConsensus
blazejkrzak Apr 15, 2021
ef2e0ee
WIP: Subscription to minimalConsensus
blazejkrzak Apr 19, 2021
c25cd18
WIP: Subscription to minimalConsensus
blazejkrzak Apr 19, 2021
98b5cf2
WIP: Subscription to minimalConsensus
blazejkrzak Apr 19, 2021
56ee8b3
WIP: Subscription to minimalConsensus
blazejkrzak Apr 19, 2021
13bd1da
WIP: Subscription to minimalConsensus
blazejkrzak Apr 19, 2021
23b6b17
WIP: Subscription to minimalConsensus
blazejkrzak Apr 19, 2021
9a4fc94
WIP: Subscription to minimalConsensus
blazejkrzak Apr 20, 2021
9f198e7
WIP: Subscription to minimalConsensus
blazejkrzak Apr 20, 2021
27c6de0
WIP: Subscription to minimalConsensus
blazejkrzak Apr 20, 2021
e701bee
WIP: Subscription to minimalConsensus
blazejkrzak Apr 21, 2021
ac62bad
WIP: Subscription to minimalConsensus
blazejkrzak Apr 21, 2021
cec9302
WIP: Subscription to minimalConsensus
blazejkrzak Apr 21, 2021
170897d
Moved GH actions files
Apr 21, 2021
6988e02
WIP: Subscription to minimalConsensus
blazejkrzak Apr 21, 2021
201cfc3
Removed vuvuzela and added tag prefix
blazejkrzak Apr 21, 2021
e034cdf
Changed bls commit
blazejkrzak Apr 22, 2021
4ecc978
Moved onto waitgroups and routines on test scenario
blazejkrzak Apr 22, 2021
de8f1d4
No race conditions for now
blazejkrzak Apr 22, 2021
c55a860
Subscription still ends on 1st epoch
blazejkrzak Apr 22, 2021
ecd9e13
Subscription test pass
blazejkrzak Apr 22, 2021
63c1ce2
Consensus information not present in cache, but notified all via channel
blazejkrzak Apr 22, 2021
6bf29b4
Moved subscription logic to separate loop
blazejkrzak Apr 22, 2021
c4aa8ae
Skipped test which should test side effects
blazejkrzak Apr 22, 2021
1767cd1
Lint improvement
blazejkrzak Apr 22, 2021
fa5aade
Added retry fallback for orchestrator (2^32 retries with 5s interval)
blazejkrzak Apr 26, 2021
2c43f0b
Merge pull request #56 from lukso-network/feature/gitactions-ci-cd
blazejkrzak Apr 26, 2021
f89f237
Added github actions to not waste more time on travis
blazejkrzak Apr 26, 2021
ec5046b
Fix of invalid arg to github actions
blazejkrzak Apr 26, 2021
2e941a2
Used build/ci.go to CI/CD workflow
blazejkrzak Apr 26, 2021
dd558af
Debug $PATH
blazejkrzak Apr 26, 2021
246db05
Debug $GOPATH, $GOBIN
blazejkrzak Apr 26, 2021
01e4423
Debug $GOPATH, $GOBIN
blazejkrzak Apr 26, 2021
af63a54
Try to set gopath, gobin
blazejkrzak Apr 26, 2021
7acc753
Try to set gopath, gobin
blazejkrzak Apr 26, 2021
3e687cb
Try to set gopath, gobin
blazejkrzak Apr 26, 2021
db496e2
Echo $PWD
blazejkrzak Apr 26, 2021
548c194
Echo $PWD
blazejkrzak Apr 26, 2021
20cada6
Echo $PWD
blazejkrzak Apr 26, 2021
1cffb7a
Echo $PWD
blazejkrzak Apr 26, 2021
bbcda6a
Echo $PWD
blazejkrzak Apr 26, 2021
65c4dab
Try to do gobin workaround
blazejkrzak Apr 26, 2021
0eb752f
Try to install gomobile at first place
blazejkrzak Apr 26, 2021
688dba2
Try to install gomobile at first place
blazejkrzak Apr 26, 2021
ae592b5
Try to install gomobile at first place
blazejkrzak Apr 26, 2021
e42b20b
Try to install gomobile at first place
blazejkrzak Apr 26, 2021
93aed98
Try to install gomobile at first place
blazejkrzak Apr 26, 2021
de73efc
Allow to fail
blazejkrzak Apr 26, 2021
f3d60a4
Run gomobile init
blazejkrzak Apr 26, 2021
ea5e1c0
Run gomobile init
blazejkrzak Apr 26, 2021
46be312
Gobin setup change
blazejkrzak Apr 26, 2021
998b49e
Added skippage to the android_test.go
blazejkrzak Apr 26, 2021
9767813
Added debug information to remote pandora protocol
blazejkrzak Apr 26, 2021
3b21990
Working on auto releaser
blazejkrzak Apr 26, 2021
334e6e0
Skipping semver validations
blazejkrzak Apr 26, 2021
61717f5
Try to run go releaser
blazejkrzak Apr 26, 2021
3875bae
Try to run go releaser
blazejkrzak Apr 26, 2021
1c9681e
Change in sealer go about notifications
blazejkrzak Apr 26, 2021
e1d66ac
Add ticker for notifications about ongoing routine
blazejkrzak Apr 26, 2021
907e196
Add ticker for notifications about ongoing routine
blazejkrzak Apr 26, 2021
d836c2c
Added more information
blazejkrzak Apr 26, 2021
e67d996
Tests should pass and circular channel usage should be fixed
blazejkrzak Apr 27, 2021
ac38282
Added test that will fail after timeout to not guess how powerful CI …
blazejkrzak Apr 27, 2021
9f20b1c
Test if CI/CD will skip
blazejkrzak Apr 27, 2021
7cbadb1
Skip on CI/CD for cache invalidation
blazejkrzak Apr 28, 2021
7909962
Moved skip to another place in code to track it
blazejkrzak Apr 28, 2021
a593d10
Merge pull request #55 from lukso-network/feature/51/subscription-to-…
blazejkrzak Apr 28, 2021
c9c79ca
pending header container implemented
meta-bot May 5, 2021
1e5c1f3
header subscription implemented. not tested
meta-bot May 5, 2021
d6f6dc2
Fix: test pandora block production
blazejkrzak May 6, 2021
93f3874
Fix: test pandora block production
blazejkrzak May 6, 2021
8f14f1b
Fix: test pandora block production
blazejkrzak May 6, 2021
84d608b
Merge pull request #60 from lukso-network/fix/test-pandora-block-prod…
blazejkrzak May 6, 2021
38ebc64
test pending header subcription is added. Now we can test the pending…
meta-bot May 11, 2021
004dbd8
full path test of subscribe pending block header
meta-bot May 11, 2021
c7ed625
comments are added with the pending header test cases
meta-bot May 11, 2021
854c007
implement dummy interface functions just for bad design of geth
meta-bot May 11, 2021
e009001
Merge branch 'epic/pandora-consensus' of https://github.com/lukso-net…
meta-bot May 11, 2021
b366e87
Merge branch 'epic/pandora-consensus' into feature/pandora-pending-he…
meta-bot May 11, 2021
e67cc09
select case statement changed in test cases
meta-bot May 11, 2021
efd4911
blockchain_test.go is changed according to the lint error
meta-bot May 11, 2021
9909f9e
goimport files added
meta-bot May 11, 2021
6e3f003
pandora test and file system pandora test goimports run
meta-bot May 11, 2021
4e3e4ad
changed interface functions
meta-bot May 11, 2021
14b6dfb
null subscription added and passed test in simulated.go
meta-bot May 11, 2021
e831eac
code changed according to the review from blaze
meta-bot May 12, 2021
eb69e93
api.go is modified according to goimports
meta-bot May 12, 2021
89d9ce6
modified pandora to receive empty hash and get all available headers
meta-bot May 12, 2021
3c48004
error testing::: pending block header getting nil pointer error
meta-bot May 12, 2021
ca96acb
error: insert chain pending header returned
meta-bot May 12, 2021
3945916
crypto bls restored
meta-bot May 12, 2021
eceab55
filter system test is modified
meta-bot May 13, 2021
c306ab1
now worker will send notification before pushing into unconfirmed dat…
meta-bot May 13, 2021
e16b69a
logs are added in the flow
meta-bot May 13, 2021
6b5bfd5
now pandora and orchestaror can send blocks between them
meta-bot May 13, 2021
92fa063
worker.go goimports modified
meta-bot May 13, 2021
6340e70
logs are removed and api is goimported
meta-bot May 14, 2021
ddee166
Merge pull request #61 from lukso-network/feature/pandora-pending-hea…
meta-bot May 15, 2021
988f163
orchestrator client module implemented
meta-bot May 31, 2021
286d021
remote tests are removed
meta-bot May 31, 2021
9f03f83
lint bug fixed
meta-bot May 31, 2021
e9ed1fc
remote orchestrator calling test removed from orcclient
meta-bot Jun 1, 2021
a8d14a2
removed comments from orclient types.go
meta-bot Jun 1, 2021
2c2f730
author name removed from orc client source code
meta-bot Jun 2, 2021
c70d2ed
typo corrected
meta-bot Jun 2, 2021
764f15e
Merge pull request #66 from lukso-network/feature/pandora-orc-client
meta-bot Jun 2, 2021
6944854
miner integration with orchestrator client
meta-bot Jun 7, 2021
4cbb06f
delete header from container added
meta-bot Jun 8, 2021
63b547a
write block with state modified
meta-bot Jun 8, 2021
8f4f48d
log debug is printed. Code is broken
meta-bot Jun 10, 2021
d08b151
Update .goreleaser.yml
patred20 Jun 10, 2021
1563fd2
Update .goreleaser.yml
patred20 Jun 10, 2021
8b46f16
Restricted goreleaser to linux/amd64
Jun 10, 2021
8b2c79d
Provided config file to goreleaser
Jun 10, 2021
01dfde8
Deleted go generate
Jun 10, 2021
15d0f54
Temporarily disabled goreleaser
Jun 10, 2021
bc713c4
Added mulinet connection
Jun 10, 2021
bcd77ce
changed binary name
Jun 10, 2021
e0c6e50
pandora engine test
meta-bot Jun 10, 2021
f548931
Feature: pandora-orc-client
blazejkrzak Jun 10, 2021
d57ae04
changed tag source
Jun 11, 2021
e453084
provide more log to debug
meta-bot Jun 11, 2021
69e0a9f
pandora extra data bug fixed
meta-bot Jun 13, 2021
96bcfc8
Merge branch 'feature/gh-actions' into feature/pandora-orc-client
meta-bot Jun 13, 2021
db5ca5e
Reverted extra data fixed
Jun 14, 2021
042b65b
Fix log context len error
Jun 14, 2021
d983f39
Donot return error from confirmation loop
Jun 14, 2021
4f62bc8
Covert status type from int to string
Jun 14, 2021
e849928
Increase re-try time limit for confirmation
Jun 14, 2021
229289d
feature pandora client buffer removed from api.go
Jun 15, 2021
06e6fb9
pending logs are printed in the api.go
Jun 15, 2021
718e548
result channel size is made to 0 in the worker.go
Jun 15, 2021
1b372b6
log changed in blockchain.go
Jun 15, 2021
46f1897
logs are added in the sending and receiving flow
Jun 21, 2021
3cc2f00
more logs are added for download fetch
Jun 21, 2021
c10d3db
pandora now support skipped block
Jun 23, 2021
e4905e8
Fix: 71 Invalid slot from pandora
blazejkrzak Jun 23, 2021
91d6434
Fix: 71 Invalid slot from pandora
blazejkrzak Jun 24, 2021
beeac39
Fix: 71 Invalid slot from pandora
blazejkrzak Jun 24, 2021
09b9d5a
Merge pull request #72 from lukso-network/fix/71/invalid-slot
blazejkrzak Jun 25, 2021
e6317b4
TestPendingBlockHeaderFullpath is removed due to pandora engine not h…
Jun 29, 2021
1f1cdce
merged with epic/pandora-consensus and conflict resolve for release.yml
Jun 29, 2021
8197a78
Merge pull request #67 from lukso-network/feature/pandora-orc-client
meta-bot Jul 6, 2021
5beb7bc
64/32bit max value is set for lru cache size
Jul 12, 2021
977f095
Merge pull request #75 from lukso-network/feature/pandora-orc-client
meta-bot Jul 12, 2021
702a475
Fix: Do not alter mix digest during header update
blazejkrzak Jul 13, 2021
e95cf12
Merge pull request #76 from lukso-network/fix/do-not-alter-mix-digest
atif-konasl Jul 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
ignore:
- goos: darwin
- goos: linux
goarch: arm
flags:
- -tags=blst_enabled
archives:
- replacements:
linux: Linux
amd64: x86_64
format: binary
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
22 changes: 22 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Deploy

on:
create:
tags:
- p-v*

jobs:
goreleaser:
runs-on: ubuntu-latest

steps:
- name: Deploy
uses: deliverybot/helm@master
with:
token: ${{ secrets.GH_TOKEN }}
chart: app
namespace: test
release: eth20
dry-run: true
env:
KUBECONFIG_FILE: ${{ secrets.KUBECONFIG }}
70 changes: 70 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Test and build

on:
push:
branches:
- '**'

jobs:
test:
strategy:
matrix:
go-version: [ 1.16 ]
platform: [ ubuntu-latest ]

runs-on: ${{ matrix.platform }}

steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: |
go get -v -t -d ./...

- name: Lint
run: go run ./build/ci.go lint

- name: Test
run: SKIP_ANDROID=true go run ./build/ci.go test

build:
strategy:
matrix:
go-version: [ 1.16 ]
# Add additional platforms here if we need more
# This should assure that we have buildable artifact
platform: [ ubuntu-latest ]

runs-on: ${{ matrix.platform }}

needs: [ test ]

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Checkout submodules
uses: srt32/git-actions@v0.0.3
with:
args: git submodule update --init --recursive

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Install dependencies
run: |
go get -v -t -d ./...

- name: Run build
run: go run ./build/ci.go install
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release

on:
create:
tags:
- v*
- p-v*

jobs:
release:
strategy:
matrix:
go-version: [ 1.16 ]
# Add additional platforms here if we need more
platform: [ ubuntu-latest ]

runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Checkout submodules
uses: srt32/git-actions@v0.0.3
with:
args: git submodule update --init --recursive

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Install dependencies
run: |
go get -v -t -d ./...
- name: Build binary
run: |
mkdir builds &&
go build -v --tags=blst_enabled -o ./builds/geth ./cmd/geth
# - name: Run GoReleaser
# uses: goreleaser/goreleaser-action@master
# with:
# version: latest
# workdir: ./cmd/geth
# args: release --rm-dist --snapshot --config ../../.github/.goreleaser.yml
# env:
# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}


- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.release.tag_name }}
files: |
./builds/geth
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Request Multinet Upgrade
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
export GH_TAG=${GITHUB_REF/refs\/tags\//} &&
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-d '{"event_type":"upgrade dev", "client_payload": {"repository": "PANDORA", "tag": "'$GH_TAG'"}}' \
-u "$GITHUB_TOKEN" \
https://api.github.com/repos/lukso-network/l16-multinet/dispatches
10 changes: 10 additions & 0 deletions accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,16 @@ type filterBackend struct {
bc *core.BlockChain
}

// SubscribePendingHeaderEvent is implemented due to bad design of Backend interface. Don't use it here.
func (b *filterBackend) SubscribePendingHeaderEvent(ch chan<- core.PendingHeaderEvent) event.Subscription {
return nullSubscription()
}

// GetPendingHeadsSince implements testBackend only for dummy purpose. So that existing code can run without an issue
func (b *filterBackend) GetPendingHeadsSince(ctx context.Context, from common.Hash) []*types.Header {
return nil
}

func (fb *filterBackend) ChainDb() ethdb.Database { return fb.db }
func (fb *filterBackend) EventMux() *event.TypeMux { panic("not supported") }

Expand Down
2 changes: 1 addition & 1 deletion build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ func maybeSkipArchive(env build.Environment) {
log.Printf("skipping because this is a cron job")
os.Exit(0)
}
if env.Branch != "master" && !strings.HasPrefix(env.Tag, "v1.") {
if env.Branch != "master" && !strings.HasPrefix(env.Tag, "v1.") && !strings.HasPrefix(env.Tag, "p-") {
log.Printf("skipping because branch %q, tag %q is not on the whitelist", env.Branch, env.Tag)
os.Exit(0)
}
Expand Down
4 changes: 4 additions & 0 deletions consensus/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ var (
// ErrInvalidNumber is returned if a block's number doesn't equal its parent's
// plus one.
ErrInvalidNumber = errors.New("invalid block number")

// ErrInvalidBlock happens when orchestrator does not validate the block.
// maybe it is invalid, pending or skipped.
ErrInvalidBlock = errors.New("block is not verified")
)
1 change: 1 addition & 0 deletions consensus/ethash/algorithm.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const (
cacheInitBytes = 1 << 24 // Bytes in cache at genesis
cacheGrowthBytes = 1 << 17 // Cache growth per epoch
epochLength = 30000 // Blocks per epoch
pandoraEpochLength = 32 // Blocks per pandora epoch
mixBytes = 128 // Width of mix
hashBytes = 64 // Hash length in bytes
hashWords = 16 // Number of 32 bit ints in a hash
Expand Down
33 changes: 33 additions & 0 deletions consensus/ethash/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,45 @@ func (api *API) SubmitWork(nonce types.BlockNonce, hash, digest common.Hash) boo
return false
}

var blsSignature *BlsSignatureBytes

var errc = make(chan error, 1)
select {
case api.ethash.remote.submitWorkCh <- &mineResult{
nonce: nonce,
mixDigest: digest,
hash: hash,
blsSeal: blsSignature,
errc: errc,
}:
case <-api.ethash.remote.exitCh:
return false
}
err := <-errc
return err == nil
}

// SubmitWorkBLS can be used by external miner to submit their POS solution.
// It returns an indication if the work was accepted.
// Note either an invalid solution, a stale work a non-existent work will return false.
// This submit work contains BLS storing feature.
func (api *API) SubmitWorkBLS(nonce types.BlockNonce, hash common.Hash, hexSignatureString string) bool {
if api.ethash.remote == nil {
return false
}

signatureBytes := hexutil.MustDecode(hexSignatureString)
blsSignatureBytes := new(BlsSignatureBytes)
copy(blsSignatureBytes[:], signatureBytes[:])

var errc = make(chan error, 1)

select {
case api.ethash.remote.submitWorkCh <- &mineResult{
nonce: nonce,
mixDigest: common.BytesToHash(blsSignatureBytes[:32]),
hash: hash,
blsSeal: blsSignatureBytes,
errc: errc,
}:
case <-api.ethash.remote.exitCh:
Expand Down
35 changes: 33 additions & 2 deletions consensus/ethash/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ var (
// Specification EIP-2384: https://eips.ethereum.org/EIPS/eip-2384
calcDifficultyEip2384 = makeDifficultyCalculator(big.NewInt(9000000))

// Difficulty is not used anymore in pandora vanguard symbiotic relation flow
calcDifficultyPandora = func() *big.Int { return big.NewInt(1) }

// calcDifficultyConstantinople is the difficulty adjustment algorithm for Constantinople.
// It returns the difficulty that a new block should have when created at time given the
// parent block's time and difficulty. The calculation uses the Byzantium rules, but with
Expand Down Expand Up @@ -244,7 +247,7 @@ func (ethash *Ethash) VerifyUncles(chain consensus.ChainReader, block *types.Blo
// See YP section 4.3.4. "Block Header Validity"
func (ethash *Ethash) verifyHeader(chain consensus.ChainHeaderReader, header, parent *types.Header, uncle bool, seal bool, unixNow int64) error {
// Ensure that the header's extra-data section is of a reasonable size
if uint64(len(header.Extra)) > params.MaximumExtraDataSize {
if uint64(len(header.Extra)) > params.MaximumExtraDataSize && ModePandora != ethash.config.PowMode {
return fmt.Errorf("extra-data too long: %d > %d", len(header.Extra), params.MaximumExtraDataSize)
}
// Verify the header's timestamp
Expand Down Expand Up @@ -315,6 +318,8 @@ func (ethash *Ethash) CalcDifficulty(chain consensus.ChainHeaderReader, time uin
func CalcDifficulty(config *params.ChainConfig, time uint64, parent *types.Header) *big.Int {
next := new(big.Int).Add(parent.Number, big1)
switch {
case config.IsSilesia(next):
return calcDifficultyPandora()
case config.IsMuirGlacier(next):
return calcDifficultyEip2384(time, parent)
case config.IsConstantinople(next):
Expand Down Expand Up @@ -515,6 +520,11 @@ func (ethash *Ethash) verifySeal(chain consensus.ChainHeaderReader, header *type
digest []byte
result []byte
)
if ModePandora == ethash.config.PowMode {
// Here we should check if header hash was sealed by desired validator for a slot
return ethash.verifyPandoraHeader(header)
}

// If fast-but-heavy PoW verification was requested, use an ethash dataset
if fulldag {
dataset := ethash.dataset(number, true)
Expand Down Expand Up @@ -543,6 +553,7 @@ func (ethash *Ethash) verifySeal(chain consensus.ChainHeaderReader, header *type
// until after the call to hashimotoLight so it's not unmapped while being used.
runtime.KeepAlive(cache)
}

// Verify the calculated values against the ones provided in the header
if !bytes.Equal(header.MixDigest[:], digest) {
return errInvalidMixDigest
Expand All @@ -562,6 +573,11 @@ func (ethash *Ethash) Prepare(chain consensus.ChainHeaderReader, header *types.H
return consensus.ErrUnknownAncestor
}
header.Difficulty = ethash.CalcDifficulty(chain, header.Time, parent)

if ModePandora == ethash.config.PowMode {
return ethash.PreparePandoraHeader(header)
}

return nil
}

Expand All @@ -587,6 +603,21 @@ func (ethash *Ethash) FinalizeAndAssemble(chain consensus.ChainHeaderReader, hea
func (ethash *Ethash) SealHash(header *types.Header) (hash common.Hash) {
hasher := sha3.NewLegacyKeccak256()

extraData := header.Extra
extraDataLen := len(extraData)

// Bls signature is 96 bytes long and will be inserted at the bottom of the extraData field
if ModePandora == ethash.config.PowMode && extraDataLen > signatureSize {
//extraData = extraData[:extraDataLen-signatureSize]
pandoraExtraData := new(PandoraExtraDataSealed)
pandoraExtraData.FromHeader(header)
headerExtra := new(PandoraExtraData)
headerExtra.Epoch = pandoraExtraData.Epoch
headerExtra.Turn = pandoraExtraData.Turn
headerExtra.Slot = pandoraExtraData.Slot
extraData, _ = rlp.EncodeToBytes(headerExtra)
}

rlp.Encode(hasher, []interface{}{
header.ParentHash,
header.UncleHash,
Expand All @@ -600,7 +631,7 @@ func (ethash *Ethash) SealHash(header *types.Header) (hash common.Hash) {
header.GasLimit,
header.GasUsed,
header.Time,
header.Extra,
extraData,
})
hasher.Sum(hash[:0])
return hash
Expand Down
Loading