Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
508891e
core/vm: use pointers to operations vs. copy by value
karalabe Jul 16, 2020
722b742
params: begin v1.9.18 release cycle
karalabe Jul 20, 2020
3a52c4d
Merge pull request #21336 from karalabe/tiny-ref-optimization
karalabe Jul 21, 2020
4366c45
les: make clientPool.connectedBias configurable (#21305)
binacs Jul 21, 2020
7163a66
ethclient: serialize negative block number as "pending" (#21177)
sammy007 Jul 21, 2020
123864f
whisper/whisperv6: improve test error messages (#21348)
renaynay Jul 21, 2020
9e22e91
cmd/utils: reuse existing genesis in persistent dev mode
karalabe Jul 21, 2020
0b53e48
Merge pull request #21352 from karalabe/dev-noinit-genesis
karalabe Jul 22, 2020
4c268e6
cmd/utils: implement configurable developer (--dev) account options (…
meowsbits Jul 23, 2020
997b552
build: fix GOBIN for gomobile commands (#21361)
fjl Jul 23, 2020
3a57eec
mobile: fix build on iOS (#21362)
fjl Jul 23, 2020
1059221
eth/downloader: refactor downloader + queue (#21263)
holiman Jul 24, 2020
c374447
core: fix queued transaction eviction
villanuevawill May 23, 2020
5413df1
core: fix heartbeat in txpool
rjl493456442 Jul 8, 2020
6793ffa
Merge pull request #21300 from rjl493456442/txpool-fix-queued-evictions
karalabe Jul 24, 2020
56434bf
deps: update uint256 to v1.1.1
holiman Jul 24, 2020
e997f92
Merge pull request #21368 from holiman/update_uint256
karalabe Jul 24, 2020
b1be979
params: upgrade CHTs (#21376)
rjl493456442 Jul 27, 2020
f538259
params: release Geth v1.9.18
karalabe Jul 27, 2020
69d7ae8
Merge commit '508891e' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 11, 2021
09a4be1
Merge commit '722b742' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 11, 2021
9433baa
Merge commit '3a52c4d' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 11, 2021
92e98e5
Merge commit '4366c45' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 11, 2021
1a63001
Merge commit '7163a66' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 11, 2021
bc211fe
Merge commit '123864f' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 11, 2021
d4a9147
Merge commit '9e22e91' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 11, 2021
c117aa3
Merge commit '0b53e48' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 11, 2021
3631a16
Merge commit '4c268e6' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 11, 2021
a9c6104
Merge commit '997b552' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 11, 2021
0f9cba7
Merge commit '3a57eec' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 11, 2021
ca28685
Merge commit '1059221' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 15, 2021
6ce9263
Merge commit 'c374447' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 15, 2021
0c83a9a
Merge commit '5413df1' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 15, 2021
e08ba84
Merge commit '6793ffa' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 15, 2021
0fa766c
Merge commit '56434bf' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 15, 2021
8286e44
Merge commit 'e997f92' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 15, 2021
41de562
Merge commit 'b1be979' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 15, 2021
5a37bd3
Merge commit 'f538259' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 15, 2021
e643c32
Merge branch 'master' into gastonponti/merge-upstream-1.9.18
gastonponti Jun 15, 2021
36cf5a0
Fix empty body fetch for randomness beacon calculation
gastonponti Jun 17, 2021
d82cde1
Restore comment
gastonponti Jun 18, 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
5 changes: 3 additions & 2 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -923,11 +923,12 @@ func gomobileTool(subcmd string, args ...string) *exec.Cmd {
"PATH=" + GOBIN + string(os.PathListSeparator) + os.Getenv("PATH"),
}
for _, e := range os.Environ() {
if strings.HasPrefix(e, "GOPATH=") || strings.HasPrefix(e, "PATH=") {
if strings.HasPrefix(e, "GOPATH=") || strings.HasPrefix(e, "PATH=") || strings.HasPrefix(e, "GOBIN=") {
continue
}
cmd.Env = append(cmd.Env, e)
}
cmd.Env = append(cmd.Env, "GOBIN="+GOBIN)
return cmd
}

Expand Down Expand Up @@ -999,7 +1000,7 @@ func doXCodeFramework(cmdline []string) {

if *local {
// If we're building locally, use the build folder and stop afterwards
bind.Dir, _ = filepath.Abs(GOBIN)
bind.Dir = GOBIN
build.MustRun(bind)
return
}
Expand Down
31 changes: 26 additions & 5 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
mockEngine "github.com/celo-org/celo-blockchain/consensus/consensustest"
"github.com/celo-org/celo-blockchain/consensus/istanbul"
"github.com/celo-org/celo-blockchain/core"
"github.com/celo-org/celo-blockchain/core/rawdb"
"github.com/celo-org/celo-blockchain/core/vm"
"github.com/celo-org/celo-blockchain/crypto"
"github.com/celo-org/celo-blockchain/eth"
Expand Down Expand Up @@ -1694,24 +1695,44 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
}
// Create new developer account or reuse existing one
var (
developer accounts.Account
err error
developer accounts.Account
passphrase string
err error
)
if accs := ks.Accounts(); len(accs) > 0 {
if list := MakePasswordList(ctx); len(list) > 0 {
// Just take the first value. Although the function returns a possible multiple values and
// some usages iterate through them as attempts, that doesn't make sense in this setting,
// when we're definitely concerned with only one account.
passphrase = list[0]
}
// setValidator has been called above, configuring the miner address from command line flags.
if cfg.Miner.Validator != (common.Address{}) {
developer = accounts.Account{Address: cfg.Miner.Validator}
} else if accs := ks.Accounts(); len(accs) > 0 {
developer = ks.Accounts()[0]
} else {
key, _ := crypto.HexToECDSA("add67e37fdf5c26743d295b1af6d9b50f2785a6b60bc83a8f05bd1dd4b385c6c")
developer, err = ks.ImportECDSA(key, "")
developer, err = ks.ImportECDSA(key, passphrase)
if err != nil {
Fatalf("Failed to create developer account: %v", err)
}
}
if err := ks.Unlock(developer, ""); err != nil {
if err := ks.Unlock(developer, passphrase); err != nil {
Fatalf("Failed to unlock developer account: %v", err)
}
log.Info("Using developer account", "address", developer.Address)

// Create a new developer genesis block or reuse existing one
cfg.Genesis = core.DeveloperGenesisBlock(uint64(ctx.GlobalInt(DeveloperPeriodFlag.Name)), developer.Address)
if ctx.GlobalIsSet(DataDirFlag.Name) {
// Check if we have an already initialized chain and fall back to
// that if so. Otherwise we need to generate a new genesis spec.
chaindb := MakeChainDatabase(ctx, stack)
if rawdb.ReadCanonicalHash(chaindb, 0) != (common.Hash{}) {
cfg.Genesis = nil // fallback to db content
}
chaindb.Close()
}
default:
if cfg.NetworkId == params.MainnetNetworkId {
setDNSDiscoveryDefaults(cfg, params.MainnetGenesisHash)
Expand Down
6 changes: 5 additions & 1 deletion core/tx_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ type TxPool struct {
queue map[common.Address]*txList // Queued but non-processable transactions
beats map[common.Address]time.Time // Last heartbeat from each known account
all *txLookup // All transactions to allow lookups
priced *txPricedList // All transactions sorted by price. One heap per fee currency.
priced *txPricedList // All transactions sorted by price. One heap per fee currency.

chainHeadCh chan ChainHeadEvent
chainHeadSub event.Subscription
Expand Down Expand Up @@ -772,6 +772,10 @@ func (pool *TxPool) enqueueTx(hash common.Hash, tx *types.Transaction) (bool, er
if _, exist := pool.beats[from]; !exist {
pool.beats[from] = time.Now()
}
// If we never record the heartbeat, do it right now.
if _, exist := pool.beats[from]; !exist {
pool.beats[from] = time.Now()
}
return old != nil, nil
}

Expand Down
11 changes: 11 additions & 0 deletions core/types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,17 @@ func (h *Header) SanityCheck() error {
return nil
}

// EmptyBody returns true if there is no additional 'body' to complete the header
// that is: no transactions.
func (h *Header) EmptyBody() bool {
return h.TxHash == EmptyRootHash
}

// EmptyReceipts returns true if there are no receipts for this header/block.
func (h *Header) EmptyReceipts() bool {
return h.ReceiptHash == EmptyRootHash
}

// hasherPool holds LegacyKeccak hashers.
var hasherPool = sync.Pool{
New: func() interface{} {
Expand Down
18 changes: 8 additions & 10 deletions core/types/gen_log_json.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions core/types/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ type Log struct {
// hash of the transaction
TxHash common.Hash `json:"transactionHash" gencodec:"required"`
// index of the transaction in the block
TxIndex uint `json:"transactionIndex" gencodec:"required"`
TxIndex uint `json:"transactionIndex"`
// hash of the block in which the transaction was included
BlockHash common.Hash `json:"blockHash"`
// index of the log in the block
Index uint `json:"logIndex" gencodec:"required"`
Index uint `json:"logIndex"`

// The Removed field is true if this log was reverted due to a chain reorganisation.
// You must pay attention to this field if you receive logs through a filter query.
Expand Down
15 changes: 5 additions & 10 deletions core/vm/eips.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,11 @@ func enable1884(jt *JumpTable) {
// jt[EXTCODEHASH].constantGas = params.ExtcodeHashGasEIP1884

// New opcode
jt[SELFBALANCE] = operation{
jt[SELFBALANCE] = &operation{
execute: opSelfBalance,
constantGas: GasFastStep,
minStack: minStack(0, 1),
maxStack: maxStack(0, 1),
valid: true,
}
}

Expand All @@ -89,12 +88,11 @@ func opSelfBalance(pc *uint64, interpreter *EVMInterpreter, callContext *callCtx
// - Adds an opcode that returns the current chain’s EIP-155 unique identifier
func enable1344(jt *JumpTable) {
// New opcode
jt[CHAINID] = operation{
jt[CHAINID] = &operation{
execute: opChainID,
constantGas: GasQuickStep,
minStack: minStack(0, 1),
maxStack: maxStack(0, 1),
valid: true,
}
}

Expand All @@ -119,29 +117,26 @@ func enable2200(jt *JumpTable) {
// - Adds opcodes that jump to and return from subroutines
func enable2315(jt *JumpTable) {
// New opcode
jt[BEGINSUB] = operation{
jt[BEGINSUB] = &operation{
execute: opBeginSub,
constantGas: GasQuickStep,
minStack: minStack(0, 0),
maxStack: maxStack(0, 0),
valid: true,
}
// New opcode
jt[JUMPSUB] = operation{
jt[JUMPSUB] = &operation{
execute: opJumpSub,
constantGas: GasSlowStep,
minStack: minStack(1, 0),
maxStack: maxStack(1, 0),
jumps: true,
valid: true,
}
// New opcode
jt[RETURNSUB] = operation{
jt[RETURNSUB] = &operation{
execute: opReturnSub,
constantGas: GasFastStep,
minStack: minStack(0, 0),
maxStack: maxStack(0, 0),
valid: true,
jumps: true,
}
}
6 changes: 3 additions & 3 deletions core/vm/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type Config struct {
NoRecursion bool // Disables call, callcode, delegate call and create
EnablePreimageRecording bool // Enables recording of SHA3/keccak preimages

JumpTable [256]operation // EVM instruction table, automatically populated if unset
JumpTable [256]*operation // EVM instruction table, automatically populated if unset

EWASMInterpreter string // External EWASM interpreter options
EVMInterpreter string // External EVM interpreter options
Expand Down Expand Up @@ -96,7 +96,7 @@ func NewEVMInterpreter(evm *EVM, cfg *Config) *EVMInterpreter {
// We use the STOP instruction whether to see
// the jump table was initialised. If it was not
// we'll set the default jump table.
if !cfg.JumpTable[STOP].valid {
if cfg.JumpTable[STOP] == nil {
var jt JumpTable
switch {
case evm.chainRules.IsIstanbul:
Expand Down Expand Up @@ -219,7 +219,7 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
// enough stack items available to perform the operation.
op = contract.GetOp(pc)
operation := in.cfg.JumpTable[op]
if !operation.valid {
if operation == nil {
return nil, &ErrInvalidOpCode{opcode: op}
}
// Validate stack
Expand Down
Loading