Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Commit

Permalink
Atlantis config (#50)
Browse files Browse the repository at this point in the history
* Added Atlantis fork in builtin mainnet and morden config

* Fixed difficulty test at 10_000_000 block (Atlantis)

* Added tests for Atlantis difficulty transition
  • Loading branch information
austinabell authored Jun 10, 2019
1 parent bfb67d2 commit 3f7ebcd
Show file tree
Hide file tree
Showing 4 changed files with 169 additions and 67 deletions.
188 changes: 123 additions & 65 deletions core/assets/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,35 +407,64 @@ func init() {
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x0a, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x2c, 0x0a, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x62, 0x61, 0x64, 0x48, 0x61, 0x73,
0x68, 0x65, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b,
0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a,
0x20, 0x22, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x73, 0x22, 0x2c,
0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22,
0x3a, 0x20, 0x38, 0x35, 0x30, 0x30, 0x30, 0x30, 0x30, 0x2c, 0x0a, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x22, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73,
0x22, 0x3a, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x64, 0x69,
0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, 0x2c, 0x0a, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x22, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3a, 0x20, 0x31,
0x31, 0x36, 0x35, 0x32, 0x32, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22,
0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x20, 0x22, 0x30, 0x78, 0x30, 0x35,
0x62, 0x65, 0x66, 0x33, 0x30, 0x65, 0x66, 0x35, 0x37, 0x32, 0x32, 0x37,
0x30, 0x66, 0x36, 0x35, 0x34, 0x37, 0x34, 0x36, 0x64, 0x61, 0x32, 0x32,
0x36, 0x33, 0x39, 0x61, 0x37, 0x61, 0x30, 0x63, 0x39, 0x37, 0x64, 0x64,
0x39, 0x37, 0x61, 0x37, 0x30, 0x35, 0x30, 0x62, 0x39, 0x65, 0x32, 0x35,
0x32, 0x33, 0x39, 0x31, 0x39, 0x39, 0x36, 0x61, 0x61, 0x65, 0x62, 0x36,
0x38, 0x39, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x5d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x09,
0x22, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x22, 0x3a, 0x20, 0x5b,
0x0a, 0x09, 0x09, 0x22, 0x6d, 0x61, 0x69, 0x6e, 0x6e, 0x65, 0x74, 0x5f,
0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e,
0x22, 0x2c, 0x0a, 0x09, 0x09, 0x22, 0x6d, 0x61, 0x69, 0x6e, 0x6e, 0x65,
0x74, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x2e,
0x6a, 0x73, 0x6f, 0x6e, 0x22, 0x0a, 0x09, 0x5d, 0x0a, 0x7d, 0x0a,
0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x20, 0x7b, 0x0a,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20,
0x22, 0x61, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x73, 0x22, 0x0a, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d,
0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x5d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x5d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x22, 0x62, 0x61, 0x64, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73,
0x22, 0x3a, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22,
0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3a, 0x20, 0x31, 0x31, 0x36, 0x35,
0x32, 0x32, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x48, 0x61, 0x73,
0x68, 0x22, 0x3a, 0x20, 0x22, 0x30, 0x78, 0x30, 0x35, 0x62, 0x65, 0x66,
0x33, 0x30, 0x65, 0x66, 0x35, 0x37, 0x32, 0x32, 0x37, 0x30, 0x66, 0x36,
0x35, 0x34, 0x37, 0x34, 0x36, 0x64, 0x61, 0x32, 0x32, 0x36, 0x33, 0x39,
0x61, 0x37, 0x61, 0x30, 0x63, 0x39, 0x37, 0x64, 0x64, 0x39, 0x37, 0x61,
0x37, 0x30, 0x35, 0x30, 0x62, 0x39, 0x65, 0x32, 0x35, 0x32, 0x33, 0x39,
0x31, 0x39, 0x39, 0x36, 0x61, 0x61, 0x65, 0x62, 0x36, 0x38, 0x39, 0x22,
0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d,
0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x09, 0x22, 0x69, 0x6e,
0x63, 0x6c, 0x75, 0x64, 0x65, 0x22, 0x3a, 0x20, 0x5b, 0x0a, 0x09, 0x09,
0x22, 0x6d, 0x61, 0x69, 0x6e, 0x6e, 0x65, 0x74, 0x5f, 0x67, 0x65, 0x6e,
0x65, 0x73, 0x69, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x22, 0x2c, 0x0a,
0x09, 0x09, 0x22, 0x6d, 0x61, 0x69, 0x6e, 0x6e, 0x65, 0x74, 0x5f, 0x62,
0x6f, 0x6f, 0x74, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x2e, 0x6a, 0x73, 0x6f,
0x6e, 0x22, 0x0a, 0x09, 0x5d, 0x0a, 0x7d, 0x0a,
},
fi: FileInfo{
name: "mainnet.json",
size: 3503,
modTime: time.Unix(0, 1553983028384120351),
size: 3848,
modTime: time.Unix(0, 1560181764438416644),
isDir: false,
},
}, "/core/config/mainnet_bootnodes.json": File{
Expand Down Expand Up @@ -587,7 +616,7 @@ func init() {
fi: FileInfo{
name: "mainnet_bootnodes.json",
size: 1715,
modTime: time.Unix(0, 1553983028384120351),
modTime: time.Unix(0, 1557151641841114111),
isDir: false,
},
}, "/core/config/mainnet_genesis.json": File{
Expand Down Expand Up @@ -623,7 +652,7 @@ func init() {
fi: FileInfo{
name: "mainnet_genesis.json",
size: 313,
modTime: time.Unix(0, 1553983028384120351),
modTime: time.Unix(0, 1557151641841269630),
isDir: false,
},
}, "/core/config/mainnet_genesis_alloc.csv": File{
Expand Down Expand Up @@ -50741,7 +50770,7 @@ func init() {
fi: FileInfo{
name: "mainnet_genesis_alloc.csv",
size: 601300,
modTime: time.Unix(0, 1553983028392120353),
modTime: time.Unix(0, 1557151641845138227),
isDir: false,
},
}, "/core/config/morden.json": File{
Expand Down Expand Up @@ -51016,48 +51045,77 @@ func init() {
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x0a, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x2c, 0x0a, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x62, 0x61, 0x64, 0x48, 0x61, 0x73,
0x68, 0x65, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b,
0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a,
0x20, 0x22, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x73, 0x22, 0x2c,
0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22,
0x3a, 0x20, 0x34, 0x37, 0x32, 0x39, 0x32, 0x37, 0x34, 0x2c, 0x0a, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x22, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73,
0x22, 0x3a, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x64, 0x69,
0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, 0x2c, 0x0a, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x22, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3a, 0x20, 0x33,
0x38, 0x33, 0x37, 0x39, 0x32, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22,
0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x20, 0x22, 0x30, 0x78, 0x39, 0x36,
0x39, 0x30, 0x64, 0x62, 0x35, 0x34, 0x39, 0x36, 0x38, 0x61, 0x37, 0x36,
0x30, 0x37, 0x30, 0x34, 0x64, 0x39, 0x39, 0x62, 0x38, 0x31, 0x31, 0x38,
0x62, 0x66, 0x37, 0x39, 0x64, 0x35, 0x36, 0x35, 0x37, 0x31, 0x31, 0x36,
0x36, 0x39, 0x63, 0x65, 0x66, 0x61, 0x64, 0x32, 0x34, 0x62, 0x35, 0x31,
0x62, 0x35, 0x62, 0x31, 0x30, 0x31, 0x33, 0x64, 0x38, 0x32, 0x37, 0x38,
0x30, 0x38, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20,
0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x20, 0x7b, 0x0a,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20,
0x22, 0x61, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x73, 0x22, 0x0a, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x22, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3a, 0x20, 0x31, 0x39,
0x31, 0x35, 0x32, 0x37, 0x37, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d,
0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x5d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x5d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x22, 0x62, 0x61, 0x64, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73,
0x22, 0x3a, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22,
0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x20, 0x22, 0x30, 0x78, 0x33, 0x62,
0x65, 0x66, 0x39, 0x39, 0x39, 0x37, 0x33, 0x34, 0x30, 0x61, 0x63, 0x65,
0x62, 0x63, 0x38, 0x35, 0x62, 0x38, 0x34, 0x39, 0x34, 0x38, 0x64, 0x38,
0x34, 0x39, 0x63, 0x65, 0x65, 0x66, 0x66, 0x37, 0x34, 0x33, 0x38, 0x34,
0x64, 0x64, 0x66, 0x35, 0x31, 0x32, 0x61, 0x32, 0x30, 0x36, 0x37, 0x36,
0x64, 0x34, 0x32, 0x34, 0x65, 0x39, 0x37, 0x32, 0x61, 0x33, 0x63, 0x33,
0x63, 0x34, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x5d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x09,
0x22, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x22, 0x20, 0x3a, 0x20,
0x5b, 0x0a, 0x09, 0x09, 0x22, 0x6d, 0x6f, 0x72, 0x64, 0x65, 0x6e, 0x5f,
0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e,
0x22, 0x2c, 0x0a, 0x09, 0x09, 0x22, 0x6d, 0x6f, 0x72, 0x64, 0x65, 0x6e,
0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x2e, 0x6a,
0x73, 0x6f, 0x6e, 0x22, 0x0a, 0x09, 0x5d, 0x0a, 0x7d, 0x0a,
0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3a, 0x20, 0x33, 0x38, 0x33, 0x37,
0x39, 0x32, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x48, 0x61, 0x73,
0x68, 0x22, 0x3a, 0x20, 0x22, 0x30, 0x78, 0x39, 0x36, 0x39, 0x30, 0x64,
0x62, 0x35, 0x34, 0x39, 0x36, 0x38, 0x61, 0x37, 0x36, 0x30, 0x37, 0x30,
0x34, 0x64, 0x39, 0x39, 0x62, 0x38, 0x31, 0x31, 0x38, 0x62, 0x66, 0x37,
0x39, 0x64, 0x35, 0x36, 0x35, 0x37, 0x31, 0x31, 0x36, 0x36, 0x39, 0x63,
0x65, 0x66, 0x61, 0x64, 0x32, 0x34, 0x62, 0x35, 0x31, 0x62, 0x35, 0x62,
0x31, 0x30, 0x31, 0x33, 0x64, 0x38, 0x32, 0x37, 0x38, 0x30, 0x38, 0x22,
0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x42,
0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3a, 0x20, 0x31, 0x39, 0x31, 0x35, 0x32,
0x37, 0x37, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x48, 0x61, 0x73,
0x68, 0x22, 0x3a, 0x20, 0x22, 0x30, 0x78, 0x33, 0x62, 0x65, 0x66, 0x39,
0x39, 0x39, 0x37, 0x33, 0x34, 0x30, 0x61, 0x63, 0x65, 0x62, 0x63, 0x38,
0x35, 0x62, 0x38, 0x34, 0x39, 0x34, 0x38, 0x64, 0x38, 0x34, 0x39, 0x63,
0x65, 0x65, 0x66, 0x66, 0x37, 0x34, 0x33, 0x38, 0x34, 0x64, 0x64, 0x66,
0x35, 0x31, 0x32, 0x61, 0x32, 0x30, 0x36, 0x37, 0x36, 0x64, 0x34, 0x32,
0x34, 0x65, 0x39, 0x37, 0x32, 0x61, 0x33, 0x63, 0x33, 0x63, 0x34, 0x22,
0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d,
0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x09, 0x22, 0x69, 0x6e,
0x63, 0x6c, 0x75, 0x64, 0x65, 0x22, 0x20, 0x3a, 0x20, 0x5b, 0x0a, 0x09,
0x09, 0x22, 0x6d, 0x6f, 0x72, 0x64, 0x65, 0x6e, 0x5f, 0x67, 0x65, 0x6e,
0x65, 0x73, 0x69, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x22, 0x2c, 0x0a,
0x09, 0x09, 0x22, 0x6d, 0x6f, 0x72, 0x64, 0x65, 0x6e, 0x5f, 0x62, 0x6f,
0x6f, 0x74, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e,
0x22, 0x0a, 0x09, 0x5d, 0x0a, 0x7d, 0x0a,
},
fi: FileInfo{
name: "morden.json",
size: 3682,
modTime: time.Unix(0, 1553983028392120353),
size: 4027,
modTime: time.Unix(0, 1560181783605550267),
isDir: false,
},
}, "/core/config/morden_bootnodes.json": File{
Expand Down Expand Up @@ -51279,7 +51337,7 @@ func init() {
fi: FileInfo{
name: "morden_bootnodes.json",
size: 2552,
modTime: time.Unix(0, 1553983028392120353),
modTime: time.Unix(0, 1557151641845727425),
isDir: false,
},
}, "/core/config/morden_genesis.json": File{
Expand Down Expand Up @@ -51319,7 +51377,7 @@ func init() {
fi: FileInfo{
name: "morden_genesis.json",
size: 364,
modTime: time.Unix(0, 1553983028392120353),
modTime: time.Unix(0, 1557151641845960509),
isDir: false,
},
}, "/core/config/morden_genesis_alloc.csv": File{
Expand Down Expand Up @@ -51353,7 +51411,7 @@ func init() {
fi: FileInfo{
name: "morden_genesis_alloc.csv",
size: 295,
modTime: time.Unix(0, 1553983028392120353),
modTime: time.Unix(0, 1557151641846116887),
isDir: false,
},
},
Expand Down
24 changes: 22 additions & 2 deletions core/block_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,12 @@ func TestCalcDifficulty1Mainnet(t *testing.T) {
t.Error("missing Defuse Difficulty Bomb fork block")
}

// Atlantis
atlantisBlock := config.ForkByName("Atlantis").Block
if defuseBlock == nil {
t.Error("missing Atlantis fork block")
}

defuseFeat, _, defuseConfigured := config.GetFeature(defuseBlock, "difficulty")
if !defuseConfigured {
t.Errorf("difficulty not configured for Defuse Difficulty Bomb block: %v", dhB)
Expand Down Expand Up @@ -391,7 +397,11 @@ func TestCalcDifficulty1Mainnet(t *testing.T) {
new(big.Int).Add(defuseBlock, big.NewInt(0)): calcDifficultyDefused(time, parentTime, new(big.Int).Add(defuseBlock, big.NewInt(0)), parentDiff),
new(big.Int).Add(defuseBlock, big.NewInt(1)): calcDifficultyDefused(time, parentTime, new(big.Int).Add(defuseBlock, big.NewInt(1)), parentDiff),

big.NewInt(10000000): calcDifficultyDefused(time, parentTime, big.NewInt(10000000), parentDiff),
new(big.Int).Add(atlantisBlock, big.NewInt(-1)): calcDifficultyAtlantis(time, &types.Header{Number: new(big.Int).Add(atlantisBlock, big.NewInt(-1)), Time: new(big.Int).SetUint64(parentTime), Difficulty: parentDiff}),
new(big.Int).Add(atlantisBlock, big.NewInt(0)): calcDifficultyAtlantis(time, &types.Header{Number: new(big.Int).Add(atlantisBlock, big.NewInt(0)), Time: new(big.Int).SetUint64(parentTime), Difficulty: parentDiff}),
new(big.Int).Add(atlantisBlock, big.NewInt(1)): calcDifficultyAtlantis(time, &types.Header{Number: new(big.Int).Add(atlantisBlock, big.NewInt(1)), Time: new(big.Int).SetUint64(parentTime), Difficulty: parentDiff}),

big.NewInt(10000000): calcDifficultyAtlantis(time, &types.Header{Number: big.NewInt(10000000), Time: new(big.Int).SetUint64(parentTime), Difficulty: parentDiff}),
}

for parentNum, expected := range table {
Expand Down Expand Up @@ -435,6 +445,12 @@ func TestCalcDifficulty1Morden(t *testing.T) {
t.Error("missing Defuse Difficulty Bomb fork block")
}

// Atlantis
atlantisBlock := config.ForkByName("Atlantis").Block
if defuseBlock == nil {
t.Error("missing Atlantis fork block")
}

defuseFeat, _, defuseConfigured := config.GetFeature(defuseBlock, "difficulty")
if !defuseConfigured {
t.Errorf("difficulty not configured for Defuse Difficulty Bomb block: %v", dhB)
Expand Down Expand Up @@ -469,7 +485,11 @@ func TestCalcDifficulty1Morden(t *testing.T) {
new(big.Int).Add(defuseBlock, big.NewInt(0)): calcDifficultyDefused(time, parentTime, new(big.Int).Add(defuseBlock, big.NewInt(0)), parentDiff),
new(big.Int).Add(defuseBlock, big.NewInt(1)): calcDifficultyDefused(time, parentTime, new(big.Int).Add(defuseBlock, big.NewInt(1)), parentDiff),

big.NewInt(10000000): calcDifficultyDefused(time, parentTime, big.NewInt(10000000), parentDiff),
new(big.Int).Add(atlantisBlock, big.NewInt(-1)): calcDifficultyAtlantis(time, &types.Header{Number: new(big.Int).Add(atlantisBlock, big.NewInt(-1)), Time: new(big.Int).SetUint64(parentTime), Difficulty: parentDiff}),
new(big.Int).Add(atlantisBlock, big.NewInt(0)): calcDifficultyAtlantis(time, &types.Header{Number: new(big.Int).Add(atlantisBlock, big.NewInt(0)), Time: new(big.Int).SetUint64(parentTime), Difficulty: parentDiff}),
new(big.Int).Add(atlantisBlock, big.NewInt(1)): calcDifficultyAtlantis(time, &types.Header{Number: new(big.Int).Add(atlantisBlock, big.NewInt(1)), Time: new(big.Int).SetUint64(parentTime), Difficulty: parentDiff}),

big.NewInt(10000000): calcDifficultyAtlantis(time, &types.Header{Number: big.NewInt(10000000), Time: new(big.Int).SetUint64(parentTime), Difficulty: parentDiff}),
}

for parentNum, expected := range table {
Expand Down
12 changes: 12 additions & 0 deletions core/config/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,18 @@
}
}
]
},
{
"name": "Atlantis",
"block": 8500000,
"features": [
{
"id": "difficulty",
"options": {
"type": "atlantis"
}
}
]
}
],
"badHashes": [
Expand Down
Loading

0 comments on commit 3f7ebcd

Please sign in to comment.