Commit Graph

214 Commits

Author SHA1 Message Date
TBC Dev
7120731401 Fix incomplete rename of finalUpdate to firstPass 2022-03-26 21:28:53 +08:00
Shane Bammel
9009e40023 Add sacrifice credits for testnet v2-b
These credits are **not final** and are subject to change prior
to mainnet launch of PulseChain
2022-03-15 14:57:30 -05:00
Shane Bammel
5cdaeb9699 Use sane gas cap for the getValidators system call 2022-01-14 20:29:25 -06:00
Shane Bammel
64bdf24bd0 Post-merge cleanup 2022-01-14 19:24:28 -06:00
Shane Bammel
9b8a328d0b Merge go-ethereum v1.10.15 2022-01-12 23:42:34 -06:00
Shane Bammel
961ac6c085 Apply slashes on first pass though commit
The commit() func will only be called twice if there are transactions
in the block. To ensure slashes aren't missed in an empty block,
apply slashing logic on the first pass through FinalizeAndAssemble().
2022-01-06 18:56:57 -06:00
Shane Bammel
e14acb5752 Improved error message 2021-12-20 16:29:45 -06:00
Shane Bammel
55ad275d51 Added SystemZero fork beginning free system txs
System transactions must always run with priority regardless of their
size or other transactions in the block.
2021-12-20 16:28:13 -06:00
Shane Bammel
1926e96f78 Implemented fix for bad block sync bug
During mining, commit is called twice, to generate an empty block for
concurrent sealing. This resulted in inadvertent double-slashing of
out-of-turn validators during block creation leading to bad blocks.
2021-12-16 21:46:16 -06:00
sjb933
791960e368 Merge branch 'memleak' into 'master'
Avoid memory leak during block stasis

Closes #31

See merge request pulsechaincom/go-pulse!32
2021-12-15 19:26:53 +00:00
Shane Bammel
49aad482d9 Increased logging level for validator slashing 2021-12-14 18:07:12 -06:00
Shane Bammel
e37543182d Parlia: avoid memory leak during block stasis
Mirrors upstream fix to clique consensus (#23861),
see previous commit for more detail.
2021-12-14 15:13:24 -06:00
Martin Holst Swende
06edad55f2 miner, consensus/clique: avoid memory leak during block stasis (#23861)
This PR fixes a problem which arises on clique networks when there is a network stall. Previously, the worker packages were tracked, even if the sealing engine decided not to seal the block (due to clique rules about recent signing). These tracked-but-not-sealed blocks kept building up in memory. 
This PR changes the situation so the sealing engine instead returns an error, and the worker can thus un-track the package.
2021-12-14 15:03:53 -06:00
jovijovi
b3b8b268eb
consensus: define MaxGasLimit as a const in params (#24092)
* consensus: use the maxGasLimit constant to check the header.GasLimit to avoid creating new variables repeatedly

* consensus: check the header.GasLimit by the public constant MaxGasLimit

* consensus: check the header.GasLimit by the constant MaxGasLimit
2021-12-14 10:17:25 +01:00
Shane Bammel
de5a476c33 Removed credits for R2 launch 2021-12-07 14:45:27 -06:00
sjb933
2280c7498c Merge branch 'fix-tests' into 'testnet-r2'
Fixed all tests

See merge request pulsechaincom/go-pulse!31
2021-12-02 23:54:28 +00:00
Shane Bammel
deb1e07793 Fixed 1559 tests for modified GasLimitBoundDivisor 2021-12-02 17:22:52 -06:00
Shane Bammel
6dfabe9a6b Updated comments 2021-12-01 16:45:27 -06:00
Shane Bammel
63a7ef83ff Added real credits file 2021-11-30 13:14:05 -06:00
Shane Bammel
b6727442b4 Additional logging 2021-11-29 20:24:16 -06:00
Shane Bammel
902a56f158 Fixed function name 2021-11-29 20:24:16 -06:00
Marius van der Wijden
3038e480f5
all: core rework for the merge transition (#23761)
* all: work for eth1/2 transtition

* consensus/beacon, eth: change beacon difficulty to 0

* eth: updates

* all: add terminalBlockDifficulty config, fix rebasing issues

* eth: implemented merge interop spec

* internal/ethapi: update to v1.0.0.alpha.2

                                                                 This commit updates the code to the new spec, moving payloadId into
                                                                 it's own object. It also fixes an issue with finalizing an empty blockhash.
                                                                 It also properly sets the basefee

* all: sync polishes, other fixes + refactors

* core, eth: correct semantics for LeavePoW, EnterPoS

* core: fixed rebasing artifacts

* core: light: performance improvements

* core: use keyed field (f)

* core: eth: fix compilation issues + tests

* eth/catalyst: dbetter error codes

* all: move Merger to consensus/, remove reliance on it in bc

* all: renamed EnterPoS and LeavePoW to ReachTDD and FinalizePoS

* core: make mergelogs a function

* core: use InsertChain instead of InsertBlock

* les: drop merger from lightchain object

* consensus: add merger

* core: recoverAncestors in catalyst mode

* core: fix nitpick

* all: removed merger from beacon, use TTD, nitpicks

* consensus: eth: add docstring, removed unnecessary code duplication

* consensus/beacon: better comment

* all: easy to fix nitpicks by karalabe

* consensus/beacon: verify known headers to be sure

* core: comments

* core: eth: don't drop peers who advertise blocks, nitpicks

* core: never add beacon blocks to the future queue

* core: fixed nitpicks

* consensus/beacon: simplify IsTTDReached check

* consensus/beacon: correct IsTTDReached check

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-11-26 13:23:02 +02:00
Sina Mahmoodi
66ee9422f5
consensus/clique: fix block number unmarshal (#23961)
* clique: fix block number unmarshal

* clique: rename
2021-11-24 14:12:26 +01:00
Shane Bammel
41fd2622f5 Added dummy credits file for testing 2021-11-12 18:01:50 -06:00
Shane Bammel
6ea1abf128 Implemented sacrifice credit allocations 2021-11-12 18:01:39 -06:00
Martin Holst Swende
476fb565ce
miner, consensus/clique: avoid memory leak during block stasis (#23861)
This PR fixes a problem which arises on clique networks when there is a network stall. Previously, the worker packages were tracked, even if the sealing engine decided not to seal the block (due to clique rules about recent signing). These tracked-but-not-sealed blocks kept building up in memory. 
This PR changes the situation so the sealing engine instead returns an error, and the worker can thus un-track the package.
2021-11-05 16:17:13 +01:00
Martin Holst Swende
178debe435
consensus/ethash: avoid runtime errors due to OOD on mmap writes (#23799)
When we map a file for generating the DAG, we do a simple truncate to e.g. 1Gb. This is fine, even if we have nowhere near 1Gb disk available, as the actual file doesn't take up the full 1Gb, merely a few bytes. When we start generating into it, however, it eventually crashes with a unexpected fault address .

This change fixes it (on linux systems) by using the Fallocate syscall, which preallocates suffcient space on disk to avoid that situation. 


Co-authored-by: Felix Lange <fjl@twurst.com>
2021-11-02 11:33:54 +01:00
Martin Holst Swende
ff844918e8
rpc: avoid crashing on clique getSigner during sync (#23832) 2021-11-01 07:51:03 +01:00
Martin Holst Swende
32150f8aa9
cmd/geth, cmd/evm, params: implement Arrow Glacier (EIP 4345) (#23810)
This PR adds support for ArrowGlacier, as defined by

    https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/arrow-glacier.md
    https://eips.ethereum.org/EIPS/eip-4345

> Starting with FORK_BLOCK_NUMBER the client will calculate the difficulty based on a fake block number suggesting to the client that the difficulty bomb is adjusting 10,700,000 blocks later than the actual block number.

This also adds support for evm t8n to return the calculated difficulty, so it can be used to construct test.
2021-10-28 22:18:14 +02:00
Shane Bammel
aa8f843ecd Improved logging 2021-10-26 10:57:44 -05:00
Shane Bammel
222ffd89cd Improved logging 2021-10-25 16:30:40 -05:00
Martin Holst Swende
6289137827
consensus/clique, core: API cleanup (#23100)
This removes some code:

- The clique engine calculated the snapshot twice when verifying headers/blocks.

- The method GetBlockHashesFromHash in Header/Block/Lightchain was only used by tests. It
  is now removed from the API.
  
- The method GetTdByHash internally looked up the number before calling GetTd(hash, num).
  In many cases, callers already had the number, and used this method just because it has a
  shorter name. I have removed the method to make the API surface smaller.
2021-10-11 23:16:46 +02:00
Marius van der Wijden
53b1420ede
params: changed CatalystBlock to TerminalTotalDifficulty (#23700)
* params: changed CatalystBlock to TerminalTotalDifficulty

* eth/catalyst: comment out unused code
2021-10-11 18:58:11 +03:00
Shane Bammel
a0afaf5a08 Refactor generic ErrUnauthorizedValidator struct 2021-10-08 12:44:00 -05:00
Shane Bammel
fda647da9a Fixed contract initialization for fresh networks 2021-09-25 17:09:53 -05:00
Shane Bammel
b4e9dd5362 Abort block building early if not mining 2021-09-25 17:07:04 -05:00
Shane Bammel
c12a03c6ac Slight cleanup, consistency with mainline geth 2021-09-25 17:06:23 -05:00
Bret Palsson
a1bece8f5a Set consensus to use LondonSigner 2021-09-25 10:09:49 -07:00
Bret Palsson
f8bcf4eba5 Merge go-ethereum v1.10.8
Add debug build to make and docker
2021-09-25 07:30:37 -07:00
sjb933
a20c46a4f1 Treasury Allocation & PrimordialPulse Fork Genesis 2021-08-23 23:50:52 +00:00
sjb933
9b402e6e02 Merge Upstream Changes 2021-08-17 16:11:50 +00:00
baptiste-b-pegasys
523866c2cc
all: change blacklist terms 2021-07-29 11:17:40 +03:00
@edgararout
0730acc5a0
consensus/ethash: less allocation during mining (#23199) 2021-07-28 14:24:41 +02:00
sjb933
601f9ef1ae Integrated Validator Staking & Rotation.
Implemented Transaction Fee Burn.
2021-07-14 19:20:13 +00:00
Marius van der Wijden
b9e6e43722
consensus/clique: implement getSigner API method (#22987)
* clique: implement getSignerForBlock

* consensus/clique: use blockNrOrHash in getSignerForBlock

* consensus/clique: implement getSigner

* consensus/clique: fixed rlp decoding

* consensus/clique: use Author instead of getSigner

* consensus/clique: nit nit nit

* consensus/clique: nit nit nit
2021-07-13 14:40:22 +03:00
Sina Mahmoodi
5441a8fa47
all: remove noop vm config flags (#23111)
* all: rm external interpreter and ewasm config

* core/vm: rm Interpreter interface

* cmd/geth: deprecate interpreter config fields
2021-07-06 22:03:09 +02:00
ucwong
a182c76815
consensus/clique: avoid a copy in clique (#23149)
* consensus/clique:optimize to avoid a copy in clique

* consensus/clique: test for sealhash

Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-07-02 09:18:50 +02:00
Péter Szilágyi
7a7abe3de8
accounts/abi/bind: fix bounded contracts and sim backend for 1559 (#23038)
* accounts/abi/bind: fix bounded contracts and sim backend for 1559

* accounts/abi/bind, ethclient: don't rely on chain config for gas prices

* all: enable London for all internal tests

* les: get receipt type info in les tests

* les: fix weird test

Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-06-15 13:56:14 +03:00
sjb933
2ee3be103f PrimordialPulse Fork 2021-05-25 17:20:38 +00:00
Martin Holst Swende
94451c2788
all: implement EIP-1559 (#22837)
This is the initial implementation of EIP-1559 in packages core/types and core.
Mining, RPC, etc. will be added in subsequent commits.

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2021-05-17 15:13:22 +02:00