Commit Graph

249 Commits

Author SHA1 Message Date
Alex Sharov
ecb10e8548
Snapshots download and seed (#3117)
* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* Squashed 'interfaces/' content from commit e5b1945d0

git-subtree-dir: interfaces
git-subtree-split: e5b1945d02da7a7f00e2289034ee90a6edd60184

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save
2021-12-14 10:13:17 +00:00
Giulio rebuffo
23b3c1d9bc
Added reversed for proof-of-stake syncing (#3092)
* reverse sync slow but working

* progress

* p

* close request

* backwards refactoring

* cleanup 1

* added RequestAssembler

* remove trash code and spaghetti

* efficient

* fix

* refactor

* tf

* refact

* final refactoring

* headers forward restored

* test fixed

* make CI happy

* resolved comments

* not using insertList anymore

* oops

* better collectors

* removed debug config

* avoid pointers

* added sleep

* use of channels

* sleeping

* added logs for ETL

* added more cleanup

* correct glacier

* some refactoring

* maxRequests

* tweaks

* config.go

* config conflicts

* renamed functions
2021-12-13 17:46:15 +01:00
Alexandr Borodulin
22a9a9b27d
Add error tests for starknet_sendRawTransaction method (#3102)
* Add error tests for starknet_sendRawTransaction method

* Noop tx pool

* Rename cairo tx to starknet tx, refactor starknet send raw transaction test

* Remove noop tx pool

* Transaction struct

Co-authored-by: Aleksandr Borodulin <a.borodulin@axioma.lv>
2021-12-12 22:24:21 +00:00
ledgerwatch
5413a4db91
Header download simplifications (#3106)
* Header download simplifications

* Fixes

* Reuse headerRaw for inserting into DB

* Fix tests

* Fix test

* Revert to the loop in RequestMoreHeaders

* Change Warn to Debug

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-12-10 07:04:04 +00:00
ledgerwatch
d16460e676
Rename maxHeight to lowestAnchorHeight for better readability (#3105)
* Rename maxHeight to lowestAnchorHeight for better readability

* Update header_algos.go

* Rename timestamp field in anchor, add comments

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2021-12-08 21:56:02 +00:00
Enrique Jose Avila Asapche
c3ed07ca4a
Implementing basic unwind process for Proof-of-stake (#3083)
* initial commmit

* gofmt

* flipped if statement

* flipped if statement (forgot to save)

* passing unwinding to status ch

* added unwinding constant

* took out unwinding

* added statusCh

* added a return statement and a second part to the if statement

* checking for parent hash

* checking for parent hash

* changed check to check for parentHash

* staged wrong file

* changed header check to parentHash check

* channged blockhash name to a better name

* changed it to check for header.Hash()

* changed name of blocknumber to blockHash

* changed bad block to common.Hash{}
2021-12-07 17:36:12 +01:00
ledgerwatch
494853ae39
Update skip analysis and preverified hashes (#3097)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-12-06 12:40:06 +00:00
Alex Sharov
178fd1931d
Genesis sync from existing snapshots (#3087) 2021-12-05 09:03:08 +07:00
Giulio rebuffo
3c95db0078
Fixed Proof-of-stake transition (#3075)
* added download channel to stage headers

* added direct execution

* now channel of headers rather than bodies

* simplifications

* fixed ttd headerForward

* garbage removed

* added some more stepping stones

* better transition

* covered edge case

* added names to returned values

* clean
2021-12-03 11:55:00 +01:00
Giulio Rebuffo
e76bc807bb better api 2021-11-29 15:47:08 +01:00
Giulio rebuffo
cfed35921c
Merge branch 'devel' into enginev1 2021-11-29 09:57:56 +01:00
TBC Dev
57d641b6f9
Avoid redundant Block.Header() deep-copy (#3050)
* Add separate Block.Nonce() and Block.NonceU64()

* Add Block.Seal()

* Avoid redundant Block.Header() deep-copy

* Add warning comment for Block.Header()
2021-11-29 08:52:36 +00:00
Alex Sharov
8104a90993
Snapshot: exec and trie to support snapshot files (#3033) 2021-11-29 10:43:19 +07:00
ledgerwatch
c3e361eadb
Update skip analysis and preverified (#3045)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-11-28 12:59:11 +00:00
TBC Dev
16058267c4
Use sub-slices for ChainSegment actions (#3043)
* Extract pruneLinkQueue() out of ProcessSegment()

* Use sub-slices for segment actions
2021-11-28 08:21:06 +00:00
TBC Dev
2f0758e817
ChainSegment efficiency (#3042)
* De-dup blockHeaders66() and blockHeaders65()

* Simplify loops and EOL detection

* Add ChainSegmentHeader struct and refactor

* Add RawRlpHash() to avoid re-encode for header hash

* Avoid multiple redundant rlpHash()

* Sort headers by height,hash to make dups consecutive

* Flip condition to reduce map lookups

* Remove redundant check

* Use rlp.RawValue rather than []byte to help self-document
2021-11-27 17:28:17 +00:00
Giulio Rebuffo
768617f412 added proper errors 2021-11-24 23:19:40 +01:00
Giulio Rebuffo
435d1d1519 channels implemented 2021-11-24 23:00:00 +01:00
Alex Sharov
6d24a30a01
Drop txpool v1 (#3017)
* drop_txpool_v1

* drop_txpool_v1

Co-authored-by: Alex Sharp <alexsharp@alexs-macbook-pro.home>
2021-11-22 18:38:51 +00:00
TBC Dev
e1c44cd19b
Change sentry peer_id from H512 pubkey to H256 keccak256(pubkey) (#3013)
* Rename protoHandshake.ID to protoHandshake.Pubkey

* Fix enode.ID comment descriptions

* Change sentry peer_id from H512 pubkey to H256 keccak256(pubkey)

* Simplify PeerInfo helpers
2021-11-22 05:39:31 +00:00
ledgerwatch
3335532481
Update preverified hashes for mainnet and ropsten (#3010)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-11-21 16:43:40 +00:00
Alex Sharov
5b634a790e
Canonical tx ids (#2986)
* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save
2021-11-18 14:07:55 +00:00
Giulio rebuffo
e6916d4d00
[EIP-4399 2/3] Added total difficulty stage and transition logic (#2964)
* added diff stage

* added td stage

* improvements + more tests

* added err check

* added err check

* transition raw interfaces

* interface for transition

* unwind updates

* maybe this fix

* now fixed?

* fixes

* better db-format

* better db-format

* sum and mod

* sum and mod

* fixed headers unwind
2021-11-17 15:50:41 +00:00
ledgerwatch
2ad6ca10cf
Ropsten and main net preverified hashes, skip analysis (#2973)
* Ropsten preverified hashes

* Pre-verified hashes for mainnet, skip analysis

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-11-16 20:14:26 +00:00
TBC Dev
5ddbf843d1
Avoid a redundant rlpHash() in FeedHeader() (#2959) 2021-11-15 08:52:14 +00:00
TBC Dev
3df4197f2e
Fix header skeleton (#2945)
* Fix underflow only

* Rename queryRange to maxHeight

* Fix additional cases
2021-11-11 07:53:32 +00:00
alex.sharov
5d0f081a9c save 2021-11-04 15:45:55 +07:00
Alex Sharov
702631bf6f
prohibit change prune mode (#2908) 2021-11-03 20:05:52 +07:00
Alex Sharov
8c6c9527db
Drop --txpool.v1 flag (#2901) 2021-11-02 09:35:58 +07:00
Alex Sharov
fc010b77ee
Switch sentry mock to pool v2 (#2885)
* save

* save

* save

* save

* save

* save

* save

* pool v2 docs

* pool v2 docs

* pool v2 docs

* save

* save

* save

* save

* save

* save

* save
2021-10-28 21:18:34 +07:00
ledgerwatch
79b5de6d8e
Update header_algos.go (#2882) 2021-10-28 09:17:03 +01:00
Alex Sharov
84da57f62c
revert run only stage.Headers at first cycle (#2879) 2021-10-28 10:13:00 +07:00
ledgerwatch
3f21910963
Update preverified headers (main net, roosten), update skip analysis block (#2875)
* Preverified headers

* Update skip analysis

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-10-27 17:16:20 +01:00
ledgerwatch
113a9be3b8
[header download] Preserve heap invariant in SentRequest function (#2873)
* [header download] Preserve heap invariant in SentRequest function

* Update header_algos.go
2021-10-27 12:34:01 +01:00
Alex Sharov
e6bd6fbfcc
Add p2p msg to panic (#2861) 2021-10-22 09:51:49 +07:00
Alex Sharov
583a753e13
start_pool_at_genesis_on_devnet (#2856) 2021-10-21 16:01:34 +07:00
ledgerwatch
626a60d0cc
Update header_algos.go (#2846) 2021-10-20 00:18:41 +01:00
ledgerwatch
5e9c08ca92
Update header_algos.go (#2840) 2021-10-19 07:50:47 +01:00
ledgerwatch
1cbde9a5ef
More robust preverification of headers and remove kludge for header download (#2833)
* Update header_algos.go

* Update stage_headers.go

* Update header_algos.go
2021-10-17 19:13:34 +01:00
ledgerwatch
f4dee87794
Fail to insert headers with missing parent (#2822)
* Update header_algos.go

* Update header_algo_test.go

* Update header_algos.go

* Update header_data_struct.go
2021-10-13 16:18:09 +01:00
Alex Sharov
bd099e4e3e
Run first cycle in one db transaction if it's small enough (#2809) 2021-10-10 19:00:13 +07:00
ledgerwatch
21823e3dd3
Extend preverified hashes for mainnet and ropsten (#2793)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-10-07 11:42:27 +01:00
Andrea Lanfranchi
3bc3be4b5f
Clean up DEBUG category logs (#2776)
- move many DEBUG logs into TRACE category
2021-10-05 08:14:04 +07:00
Andrea Lanfranchi
c913f35c2e
Inner errors (#2774) 2021-10-04 22:16:52 +07:00
Alex Sharov
de16cb9e23
add logs in recoverFromDb func (#2769) 2021-10-04 19:46:05 +07:00
Andrea Lanfranchi
f70dd63a30
Update stage_finish.go : notifications to rpc daemon (#2755) 2021-10-04 07:30:42 +07:00
e-danko
0c93c314d4
added Fermion network (#2737) 2021-09-29 08:35:43 +07:00
e-danko
7d338f5e1c
#2660: added Kovan network (#2733) 2021-09-27 19:56:17 +07:00
Alex Sharov
a148e71d9d
Pool: switch to pendingBaseFee (#2732) 2021-09-26 23:09:36 +07:00
Alexandr Borodulin
d7159cd8bd
More convenient pruning for non-PoW consensus: add --prune.*.before flags (#2714) 2021-09-23 09:13:19 +07:00