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/aura consensus #24

Draft
wants to merge 135 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
44a07e2
Added aura dir
Sep 14, 2020
95b105f
Adding cli lukso flag and auto-config of lukso node
Sep 15, 2020
da077f7
Change signature from clique to aura in aura consensus
Sep 15, 2020
c34c6ca
Initiate aura
Sep 15, 2020
bdb0ffb
Added difficulty retrival from Aura config
Sep 15, 2020
28e940c
Changed in verify header and added authorities array in AuraConfig
Sep 15, 2020
70d36a5
Fixed type of difficulty and changed prepare and seal function in aura
Sep 15, 2020
455e3e2
Added aura engine in MakeChain method for supporting different flag c…
Sep 15, 2020
deed825
Added signer checking in Seal and VerifySeal method.
Sep 15, 2020
3fd5b6b
Added aura genesis and init script
Sep 15, 2020
76714f2
Fixed new block signing problem
Sep 15, 2020
870aa8a
Sigle node produces block successfully. But multi-node cannot sync bl…
Sep 16, 2020
a0414b0
Avoid Difficulty validation
Sep 16, 2020
ee22ce2
Found the reason for the header mismatch
Sep 16, 2020
8add52c
Solved genesis mismatch problem
Sep 17, 2020
09d9eb3
Removed extra debug log
Sep 17, 2020
76e8985
Fix comments
Sep 18, 2020
064f1aa
Change genesis.json file
Sep 18, 2020
03dc309
Provided (matching?) parity and geth basic configs?
eddubbs Sep 15, 2020
0a91be4
Provided (matching?) parity and geth basic configs?
eddubbs Sep 15, 2020
3724e6f
Provided (matching?) parity and geth basic configs?
eddubbs Sep 15, 2020
8f166f4
Provided (matching?) parity and geth basic configs?
eddubbs Sep 15, 2020
d2ffcd2
Provided (matching?) parity and geth basic configs?
eddubbs Sep 15, 2020
0eba12b
Provided (matching?) parity and geth basic configs?
eddubbs Sep 15, 2020
2574e3e
Provided (matching?) parity and geth basic configs?
eddubbs Sep 15, 2020
95362be
Provided (matching?) parity and geth basic configs?
eddubbs Sep 15, 2020
4cc75bc
Provided (matching?) parity and geth basic configs?
eddubbs Sep 15, 2020
e8fee1e
Provided (matching?) parity and geth basic configs?
eddubbs Sep 16, 2020
9bb4446
Provided (matching?) parity and geth basic configs?
eddubbs Sep 16, 2020
2b5d286
Provided (matching?) parity and geth basic configs?
eddubbs Sep 16, 2020
34f43b5
Provided (matching?) parity and geth basic configs?
mxmar Sep 21, 2020
9b2e077
- merged with Atif;
mxmar Sep 22, 2020
46aaf5d
- merged with Atif;
mxmar Sep 23, 2020
fa0b8de
Debug mix digest with test from empty string
eddubbs Sep 24, 2020
47a6eb6
Debug mix digest with test from empty string
eddubbs Sep 24, 2020
0832567
Unstable state but I do not want to loose changes
eddubbs Sep 24, 2020
dfdb59d
- fixed "genesis"->"seal"->"authorityRound";
mxmar Sep 24, 2020
ed02334
This is mess, but fetch it
eddubbs Sep 24, 2020
8c4aff9
Error: Header in aura block is nil
eddubbs Sep 25, 2020
9597dff
- testing block header parser;
mxmar Sep 25, 2020
8b54cb7
- TestBlockEncodingAuraHeader;
mxmar Sep 25, 2020
5ea9f5b
- TestBlockEncodingAuraHeader;
mxmar Sep 25, 2020
ef54757
- TestBlockEncodingAura added;
mxmar Sep 25, 2020
d9bdf4f
I've got working header
eddubbs Sep 25, 2020
d0ef569
Header and block is decoding
eddubbs Sep 25, 2020
e96ab4d
Merge branch 'debug/mix-digest' of github.com:lukso-network/go-ethere…
eddubbs Sep 25, 2020
221261a
Message number 4
eddubbs Sep 25, 2020
b800e20
Hashes for block and header match
eddubbs Sep 26, 2020
b3dc8ea
Added test for encoding block latest from aura to aura header
eddubbs Sep 27, 2020
5b0de62
Working parsing from json, but not from message 0x7
eddubbs Sep 27, 2020
fefceb6
0x7 working
eddubbs Sep 27, 2020
46585ed
Both json marshaling and rlp decoding from 0x7 works
eddubbs Sep 27, 2020
dfe6b87
Fixed msg 0x04
eddubbs Sep 27, 2020
098f91a
Fixed msg 0x04
eddubbs Sep 27, 2020
653482d
Fixed msg 0x04
eddubbs Sep 27, 2020
3b8a7f2
Added test for incoming block 1
eddubbs Sep 28, 2020
e9bc003
Added test for incoming block 1.
eddubbs Sep 28, 2020
534d559
Added test for incoming block 1.
eddubbs Sep 28, 2020
fa9863e
- TestAuraGenesisBlock added;
mxmar Sep 28, 2020
b8765b6
Merge remote-tracking branch 'origin/debug/mix-digest' into debug/mix…
mxmar Sep 28, 2020
7a5915c
Added test for incoming block 1.
eddubbs Sep 28, 2020
d59d104
Merge branch 'debug/mix-digest' of github.com:lukso-network/go-ethere…
eddubbs Sep 28, 2020
ec25576
Added test for incoming block 1.
eddubbs Sep 28, 2020
7de7497
Added test for incoming block 1.
eddubbs Sep 28, 2020
84dbfb8
Added test for incoming block 1.
eddubbs Sep 28, 2020
d3c5315
feature/16/implement-synchronization-with-l15
Sep 28, 2020
9dd94d1
feature/16/implement-synchronization-with-l15
Sep 28, 2020
afa9f6a
Added test for signing block
Sep 29, 2020
882bf72
Resolving problem with creating hash for block signature
patred20 Oct 2, 2020
7e3004d
- TestAura_VerifySeal added;
mxmar Oct 5, 2020
ac5d876
- TestAura_VerifySeal added;
mxmar Oct 5, 2020
6272d54
- TestAura_VerifySeal passes;
mxmar Oct 5, 2020
2b59d87
- TestAura_VerifySeal passes but not everytime;
mxmar Oct 5, 2020
397ff47
- TestAura_VerifySeal passes but not everytime;
mxmar Oct 5, 2020
9ee28ed
Fixed step calculation expression
patred20 Oct 5, 2020
30de7e3
- TestAura_VerifySeal passes but not everytime;
mxmar Oct 6, 2020
332b4d3
- ReadHeaderRLP modified for testing/debug purpose;
mxmar Oct 6, 2020
2ad24e1
Merge pull request #22 from lukso-network/feature/16/implement-synchr…
blazejkrzak Oct 7, 2020
3b8e05a
- Merge conflicts resolving;
mxmar Oct 7, 2020
7983e8f
Feature: 18 switch extradata to signer
blazejkrzak Oct 7, 2020
713013a
- Merge conflicts resolving;
mxmar Oct 7, 2020
ae105ee
Merge pull request #20 from lukso-network/feature/2/genesis-with-aura…
blazejkrzak Oct 7, 2020
2ea4659
Feature: 18 switch extradata to signer
blazejkrzak Oct 7, 2020
1f922e6
Feature: 18 switch extradata to signer
blazejkrzak Oct 7, 2020
2143d33
Feature: 18 switch extradata to signer
blazejkrzak Oct 7, 2020
8a4b153
Feature: 18 switch extradata to signer
blazejkrzak Oct 7, 2020
b104bf8
Feature: 18 switch extradata to signer
blazejkrzak Oct 7, 2020
3610e34
Feature: 18 switch extradata to signer
blazejkrzak Oct 7, 2020
a955c0e
Merge epic into feature 18
blazejkrzak Oct 7, 2020
6ad26be
Merge pull request #21 from lukso-network/feature/18/switch-from-extr…
blazejkrzak Oct 7, 2020
eafc6e1
Test mining for aura before implementation
blazejkrzak Oct 9, 2020
914cff3
Feature: 23 test geth as validator
blazejkrzak Oct 12, 2020
533b38a
Feature: 23 test geth as validator
blazejkrzak Oct 12, 2020
2762abb
Feature: 23 test geth as validator
blazejkrzak Oct 12, 2020
d388019
Feature: 23 test geth as validator
blazejkrzak Oct 12, 2020
3b65337
Feature: 23 test geth as validator
blazejkrzak Oct 12, 2020
2894540
Feature: 23 test geth as validator
blazejkrzak Oct 12, 2020
46f36d7
Feature: 23 test geth as validator
blazejkrzak Oct 12, 2020
323b2d3
Feature: 23 test geth as validator
blazejkrzak Oct 13, 2020
3092f6e
Feature: 23 test geth as validator
blazejkrzak Oct 13, 2020
7cbdcf2
Feature: 23 test geth as validator
blazejkrzak Oct 13, 2020
76aea04
Feature: 23 test geth as validator
blazejkrzak Oct 13, 2020
e7368ea
Feature: 23 test geth as validator
blazejkrzak Oct 13, 2020
62898e1
Feature: 23 test geth as validator
blazejkrzak Oct 13, 2020
c7800eb
Feature: 23 test geth as validator
blazejkrzak Oct 13, 2020
f3c8e2c
Feature: 23 test geth as validator
blazejkrzak Oct 13, 2020
70fdf5b
Feature: 23 test geth as validator
blazejkrzak Oct 13, 2020
fd638bd
Feature: 23 test geth as validator
blazejkrzak Oct 14, 2020
d285294
Feature: 23 test geth as validator
blazejkrzak Oct 14, 2020
680bc80
Feature: 23 test geth as validator
blazejkrzak Oct 16, 2020
6683219
Feature: 23 test geth as validator
blazejkrzak Oct 16, 2020
10f3ce4
Feature: 23 test geth as validator
blazejkrzak Oct 19, 2020
fd27445
Feature: 23 test geth as validator
blazejkrzak Oct 19, 2020
630f546
Feature: 23 test geth as validator
blazejkrzak Oct 20, 2020
45f24bf
Feature: 23 test geth as validator
blazejkrzak Oct 20, 2020
bd1e7e2
Merge pull request #28 from lukso-network/feature/23/test-geth-as-val…
blazejkrzak Oct 21, 2020
ce19823
Feature: 26 stress testing aura port
blazejkrzak Oct 24, 2020
fe62945
Feature: 26 stress testing aura port
blazejkrzak Oct 24, 2020
da93317
Merge pull request #29 from lukso-network/feature/26/stress-testing-a…
blazejkrzak Oct 24, 2020
803f85a
Feature: 04 puppeth integration
blazejkrzak Oct 24, 2020
0a20355
Feature: 04 puppeth integration
blazejkrzak Oct 24, 2020
55220bc
Feature: 04 puppeth integration
blazejkrzak Oct 29, 2020
3280983
Feature: 04 puppeth integration
blazejkrzak Oct 30, 2020
f32b341
Feature: 04 puppeth integration
blazejkrzak Oct 30, 2020
5f370c0
Feature: 04 puppeth integration
blazejkrzak Nov 4, 2020
7da6eac
Feature: 04 puppeth integration
blazejkrzak Nov 4, 2020
9c8d22b
Feature: 04 puppeth integration
blazejkrzak Nov 5, 2020
b64f831
Merge pull request #32 from lukso-network/feature/04/puppeth-integration
blazejkrzak Nov 5, 2020
f0e35c7
Fix: Panic from parity sync
blazejkrzak Nov 9, 2020
fc2fe05
Merge pull request #37 from lukso-network/fix/panic-from-parity
blazejkrzak Nov 18, 2020
e4112a3
This is fix for invalid header from cache that led to desynchronizati…
blazejkrzak Nov 18, 2020
8c68e04
Merge pull request #39 from lukso-network/fix/35/invalid-header-from-…
blazejkrzak Nov 18, 2020
189c518
Fixed invalid header delivery and wrong difficulty
patred20 Nov 25, 2020
c1a90f7
Refactored nested if
patred20 Nov 27, 2020
f000343
Merge pull request #42 from lukso-network/fix/invalid-headers-from-geth
blazejkrzak Nov 27, 2020
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
12 changes: 8 additions & 4 deletions consensus/aura/aura.go
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@ package aura
import (
"bytes"
"errors"
"fmt"
"io"
"math/big"
"sync"
@@ -425,12 +426,15 @@ func (a *Aura) verifySeal(chain consensus.ChainHeaderReader, header *types.Heade
return err
}
// Checking authorization
ts := uint64(time.Now().Unix())
step := ts % a.config.Period
ts := header.Time

step := ts / a.config.Period
println(header.Number.Uint64())
patred20 marked this conversation as resolved.
Show resolved Hide resolved

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This println should be removed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree


turn := step % uint64(len(a.config.Authorities))
// For Patrick purpose:
//fmt.Println(fmt.Sprintf("Block no: %v, Expecting: %s, current: %s", number, a.config.Authorities[turn].Hash().String(), signer.Hash().String()))

if signer != a.config.Authorities[turn] {
fmt.Println(fmt.Sprintf("Block no: %v, Expecting: %s, current: %s", number, a.config.Authorities[turn].String(), signer.String()))
patred20 marked this conversation as resolved.
Show resolved Hide resolved
// not authorized to sign
return errUnauthorizedSigner
}