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

Hawaii fork #34

Merged
merged 50 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
0ae6407
consensus/dc: migrate DC chain data
0xcb9ff9 Jun 8, 2023
3414452
consensus/dc: update state,fix receipt type convert
0xcb9ff9 Jun 9, 2023
4b4adee
internal/ethapi: compatible DC eth_call
0xcb9ff9 Jun 12, 2023
5325bde
config: merge genesis.json config
0xcb9ff9 Aug 4, 2023
af34006
internal/ethapi: fix eth_estimateGas API
0xcb9ff9 Aug 31, 2023
3d58587
core/rawdb: fix unit test,add block header check hack
0xcb9ff9 Sep 6, 2023
2ba7fb8
internal/ethapi: fix dc eth_call nonce
0xcb9ff9 Sep 11, 2023
429093d
consensus: use ibft engine on top of all engine
DarianShawn Jul 31, 2023
0c58f91
consensus: new ibft consensus
DarianShawn Aug 1, 2023
fb4f8ab
consensus: rename ibft to drab
DarianShawn Aug 30, 2023
068804c
consensus/drab: finalize block
DarianShawn Aug 30, 2023
529dc28
consensus/drab: prepare hawaii block with drab mix digest
DarianShawn Aug 31, 2023
2883089
consensus: place drab engine config on top
DarianShawn Aug 31, 2023
8c9f812
vm: remove ibft instructionset
DarianShawn Aug 31, 2023
2286083
core: do not burn base gas
DarianShawn Aug 31, 2023
d4aa97f
vm: activate hawaii precomile contracts
DarianShawn Aug 31, 2023
637ec1b
cmd/genesis-gen: enable several blocks in hawaii hardfork
DarianShawn Aug 31, 2023
764f266
core: upgrade hawaii contracts in test environments
DarianShawn Sep 1, 2023
60e4901
consensus/drab: fix slash parameter
DarianShawn Sep 4, 2023
459175a
consensus/drab: provide validator snapshot during hawaii hardfork
DarianShawn Sep 4, 2023
f3dfe48
consensus/drab: block base fee on hawaii fork
DarianShawn Sep 5, 2023
3e646d2
consensus/drab: system transactions apply failed
DarianShawn Sep 5, 2023
60cde7f
consensus/drab: return true if it is system transaction
DarianShawn Sep 6, 2023
7fd012d
consensus/drab: use misc london gas logic
DarianShawn Sep 6, 2023
0c40987
consensus/drab: verify london gas limit after hawaii fork
DarianShawn Sep 6, 2023
be115f6
consensus/drab: update snapshot at the beginning of epoch
DarianShawn Sep 6, 2023
7b1292f
consensus: fix eip1559 base fee
DarianShawn Sep 6, 2023
d599e2e
params: set london fork basefee to 0
DarianShawn Sep 11, 2023
80556a7
consensus/drab: use same recent sign limit to avoid 1/3 failure
DarianShawn Sep 11, 2023
e1f77c4
types: header rlp hash after hawaii fork test
DarianShawn Sep 11, 2023
b923a0a
miner: upgrade default minimum gas price to 250 GWei
DarianShawn Sep 11, 2023
89c018c
eth: upgrade default max gas price to 25000 GWei
DarianShawn Sep 11, 2023
b75f5b6
consensus/misc: fix unit tests of base fee
DarianShawn Sep 11, 2023
9f99534
fix: other unit tests
DarianShawn Sep 12, 2023
eb36e64
fix: go mod binding test
DarianShawn Sep 18, 2023
36f4dba
fix: remove deprecated ioutil package
DarianShawn Sep 18, 2023
683f288
api: skip matching log bloom filter with dc blocks
DarianShawn Sep 28, 2023
59f68ab
api: fix filter test failure
DarianShawn Sep 28, 2023
100cd07
fix: remove cache append on insert chain
0xcb9ff9 Oct 9, 2023
80bffa4
eth: remove default txfee cap
DarianShawn Oct 10, 2023
522fa39
fix: eth_call rpc panic
DarianShawn Oct 10, 2023
5a66061
fix: evm call translate to dc
0xcb9ff9 Oct 10, 2023
1ed3e1f
fix: fix dc gas
0xcb9ff9 Oct 10, 2023
98e38e7
fix: fix transaction field
0xcb9ff9 Oct 10, 2023
1e3a92c
fix: fix docall logic
0xcb9ff9 Oct 10, 2023
ec6587d
fix: remove checkpoint snapshot recent signs if not correct
DarianShawn Oct 10, 2023
2f59e73
debug: more logs on recently signed failure
DarianShawn Oct 11, 2023
7a0cce9
fix: failed to seal due to candidate validators
DarianShawn Oct 11, 2023
b76e59a
consensus/drab: increase checkpoint interval
DarianShawn Oct 20, 2023
df53acc
fix: merge dev conflict
DarianShawn Oct 21, 2023
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: 2 additions & 3 deletions accounts/abi/bind/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"crypto/ecdsa"
"errors"
"io"
"io/ioutil"
"math/big"

"github.com/ethereum/go-ethereum/accounts"
Expand All @@ -45,7 +44,7 @@ var ErrNotAuthorized = errors.New("not authorized to sign this account")
// Deprecated: Use NewTransactorWithChainID instead.
func NewTransactor(keyin io.Reader, passphrase string) (*TransactOpts, error) {
log.Warn("WARNING: NewTransactor has been deprecated in favour of NewTransactorWithChainID")
json, err := ioutil.ReadAll(keyin)
json, err := io.ReadAll(keyin)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -106,7 +105,7 @@ func NewKeyedTransactor(key *ecdsa.PrivateKey) *TransactOpts {
// NewTransactorWithChainID is a utility method to easily create a transaction signer from
// an encrypted json key stream and the associated passphrase.
func NewTransactorWithChainID(keyin io.Reader, passphrase string, chainID *big.Int) (*TransactOpts, error) {
json, err := ioutil.ReadAll(keyin)
json, err := io.ReadAll(keyin)
if err != nil {
return nil, err
}
Expand Down
4 changes: 4 additions & 0 deletions accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,10 @@ func (fb *filterBackend) SubscribePendingLogsEvent(ch chan<- []*types.Log) event
return nullSubscription()
}

func (fb *filterBackend) SkipBloomFilter(num *big.Int) bool {
return false
}

func (fb *filterBackend) BloomStatus() (uint64, uint64) { return 4096, 0 }

func (fb *filterBackend) ServiceFilter(ctx context.Context, ms *bloombits.MatcherSession) {
Expand Down
7 changes: 3 additions & 4 deletions accounts/abi/bind/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package bind

import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -2051,7 +2050,7 @@ func TestGolangBindings(t *testing.T) {
t.Skip("go sdk not found for testing")
}
// Create a temporary workspace for the test suite
ws, err := ioutil.TempDir("", "binding-test")
ws, err := os.MkdirTemp("", "binding-test")
if err != nil {
t.Fatalf("failed to create temporary workspace: %v", err)
}
Expand All @@ -2075,7 +2074,7 @@ func TestGolangBindings(t *testing.T) {
if err != nil {
t.Fatalf("test %d: failed to generate binding: %v", i, err)
}
if err = ioutil.WriteFile(filepath.Join(pkg, strings.ToLower(tt.name)+".go"), []byte(bind), 0600); err != nil {
if err = os.WriteFile(filepath.Join(pkg, strings.ToLower(tt.name)+".go"), []byte(bind), 0600); err != nil {
t.Fatalf("test %d: failed to write binding: %v", i, err)
}
// Generate the test file with the injected test code
Expand All @@ -2091,7 +2090,7 @@ func TestGolangBindings(t *testing.T) {
%s
}
`, tt.imports, tt.name, tt.tester)
if err := ioutil.WriteFile(filepath.Join(pkg, strings.ToLower(tt.name)+"_test.go"), []byte(code), 0600); err != nil {
if err := os.WriteFile(filepath.Join(pkg, strings.ToLower(tt.name)+"_test.go"), []byte(code), 0600); err != nil {
t.Fatalf("test %d: failed to write tests: %v", i, err)
}
})
Expand Down
9 changes: 4 additions & 5 deletions accounts/keystore/account_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package keystore

import (
"fmt"
"io/ioutil"
"math/rand"
"os"
"path/filepath"
Expand Down Expand Up @@ -381,11 +380,11 @@ func TestUpdatedKeyfileContents(t *testing.T) {
return
}

// needed so that modTime of `file` is different to its current value after ioutil.WriteFile
// needed so that modTime of `file` is different to its current value after os.WriteFile
time.Sleep(1000 * time.Millisecond)

// Now replace file contents with crap
if err := ioutil.WriteFile(file, []byte("foo"), 0644); err != nil {
if err := os.WriteFile(file, []byte("foo"), 0644); err != nil {
t.Fatal(err)
return
}
Expand All @@ -398,9 +397,9 @@ func TestUpdatedKeyfileContents(t *testing.T) {

// forceCopyFile is like cp.CopyFile, but doesn't complain if the destination exists.
func forceCopyFile(dst, src string) error {
data, err := ioutil.ReadFile(src)
data, err := os.ReadFile(src)
if err != nil {
return err
}
return ioutil.WriteFile(dst, data, 0644)
return os.WriteFile(dst, data, 0644)
}
10 changes: 7 additions & 3 deletions accounts/keystore/file_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package keystore

import (
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand All @@ -41,7 +40,7 @@ func (fc *fileCache) scan(keyDir string) (mapset.Set, mapset.Set, mapset.Set, er
t0 := time.Now()

// List all the failes from the keystore folder
files, err := ioutil.ReadDir(keyDir)
files, err := os.ReadDir(keyDir)
if err != nil {
return nil, nil, nil, err
}
Expand All @@ -55,7 +54,12 @@ func (fc *fileCache) scan(keyDir string) (mapset.Set, mapset.Set, mapset.Set, er
mods := mapset.NewThreadUnsafeSet()

var newLastMod time.Time
for _, fi := range files {
for _, f := range files {
fi, err := f.Info()
if err != nil {
return nil, nil, nil, err
}

path := filepath.Join(keyDir, fi.Name())
// Skip any non-key files from the folder
if nonKeyFile(fi) {
Expand Down
3 changes: 1 addition & 2 deletions accounts/keystore/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -197,7 +196,7 @@ func writeTemporaryKeyFile(file string, content []byte) (string, error) {
}
// Atomic write: create a temporary hidden file first
// then move it into place. TempFile assigns mode 0600.
f, err := ioutil.TempFile(filepath.Dir(file), "."+filepath.Base(file)+".tmp")
f, err := os.CreateTemp(filepath.Dir(file), "."+filepath.Base(file)+".tmp")
if err != nil {
return "", err
}
Expand Down
3 changes: 1 addition & 2 deletions accounts/keystore/keystore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package keystore

import (
"io/ioutil"
"math/rand"
"os"
"runtime"
Expand Down Expand Up @@ -462,7 +461,7 @@ func checkEvents(t *testing.T, want []walletEvent, have []walletEvent) {
}

func tmpKeyStore(t *testing.T, encrypted bool) (string, *KeyStore) {
d, err := ioutil.TempDir("", "eth-keystore-test")
d, err := os.MkdirTemp("", "eth-keystore-test")
if err != nil {
t.Fatal(err)
}
Expand Down
3 changes: 1 addition & 2 deletions accounts/keystore/passphrase.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"

Expand Down Expand Up @@ -82,7 +81,7 @@ type keyStorePassphrase struct {

func (ks keyStorePassphrase) GetKey(addr common.Address, filename, auth string) (*Key, error) {
// Load the key from the keystore and decrypt its contents
keyjson, err := ioutil.ReadFile(filename)
keyjson, err := os.ReadFile(filename)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions accounts/keystore/passphrase_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package keystore

import (
"io/ioutil"
"os"
"testing"

"github.com/ethereum/go-ethereum/common"
Expand All @@ -30,7 +30,7 @@ const (

// Tests that a json key file can be decrypted and encrypted in multiple rounds.
func TestKeyEncryptDecrypt(t *testing.T) {
keyjson, err := ioutil.ReadFile("testdata/very-light-scrypt.json")
keyjson, err := os.ReadFile("testdata/very-light-scrypt.json")
if err != nil {
t.Fatal(err)
}
Expand Down
3 changes: 1 addition & 2 deletions accounts/keystore/plain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"crypto/rand"
"encoding/hex"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"reflect"
Expand All @@ -32,7 +31,7 @@ import (
)

func tmpKeyStoreIface(t *testing.T, encrypted bool) (dir string, ks keyStore) {
d, err := ioutil.TempDir("", "geth-keystore-test")
d, err := os.MkdirTemp("", "geth-keystore-test")
if err != nil {
t.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions accounts/scwallet/hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ package scwallet

import (
"encoding/json"
"io/ioutil"
"io"
"os"
"path/filepath"
"sort"
Expand Down Expand Up @@ -96,7 +96,7 @@ func (hub *Hub) readPairings() error {
return err
}

pairingData, err := ioutil.ReadAll(pairingFile)
pairingData, err := io.ReadAll(pairingFile)
if err != nil {
return err
}
Expand Down
26 changes: 12 additions & 14 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,18 @@ Usage: go run build/ci.go <command> <command flags/arguments>

Available commands are:

install [ -arch architecture ] [ -cc compiler ] [ packages... ] -- builds packages and executables
test [ -coverage ] [ packages... ] -- runs the tests
lint -- runs certain pre-selected linters
archive [ -arch architecture ] [ -type zip|tar ] [ -signer key-envvar ] [ -signify key-envvar ] [ -upload dest ] -- archives build artifacts
importkeys -- imports signing keys from env
debsrc [ -signer key-id ] [ -upload dest ] -- creates a debian source package
nsis -- creates a Windows NSIS installer
aar [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ] -- creates an Android archive
xcode [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ] -- creates an iOS XCode framework
purge [ -store blobstore ] [ -days threshold ] -- purges old archives from the blobstore
install [ -arch architecture ] [ -cc compiler ] [ packages... ] -- builds packages and executables
test [ -coverage ] [ packages... ] -- runs the tests
lint -- runs certain pre-selected linters
archive [ -arch architecture ] [ -type zip|tar ] [ -signer key-envvar ] [ -signify key-envvar ] [ -upload dest ] -- archives build artifacts
importkeys -- imports signing keys from env
debsrc [ -signer key-id ] [ -upload dest ] -- creates a debian source package
nsis -- creates a Windows NSIS installer
aar [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ] -- creates an Android archive
xcode [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ] -- creates an iOS XCode framework
purge [ -store blobstore ] [ -days threshold ] -- purges old archives from the blobstore

For all commands, -n prevents execution of external programs (dry run mode).

*/
package main

Expand All @@ -46,7 +45,6 @@ import (
"encoding/base64"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
Expand Down Expand Up @@ -754,7 +752,7 @@ func ppaUpload(workdir, ppa, sshUser string, files []string) {
if sshkey := getenvBase64("PPA_SSH_KEY"); len(sshkey) > 0 {
idfile = filepath.Join(workdir, "sshkey")
if _, err := os.Stat(idfile); os.IsNotExist(err) {
ioutil.WriteFile(idfile, sshkey, 0600)
os.WriteFile(idfile, sshkey, 0600)
}
}
// Upload
Expand All @@ -777,7 +775,7 @@ func makeWorkdir(wdflag string) string {
if wdflag != "" {
err = os.MkdirAll(wdflag, 0744)
} else {
wdflag, err = ioutil.TempDir("", "geth-build-")
wdflag, err = os.MkdirTemp("", "geth-build-")
}
if err != nil {
log.Fatal(err)
Expand Down
10 changes: 5 additions & 5 deletions build/update-license.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

//go:build none
// +build none

/*
Expand All @@ -39,7 +40,6 @@ import (
"bufio"
"bytes"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
Expand Down Expand Up @@ -241,7 +241,7 @@ func gitAuthors(files []string) []string {
}

func readAuthors() []string {
content, err := ioutil.ReadFile("AUTHORS")
content, err := os.ReadFile("AUTHORS")
if err != nil && !os.IsNotExist(err) {
log.Fatalln("error reading AUTHORS:", err)
}
Expand Down Expand Up @@ -305,7 +305,7 @@ func writeAuthors(files []string) {
content.WriteString("\n")
}
fmt.Println("writing AUTHORS")
if err := ioutil.WriteFile("AUTHORS", content.Bytes(), 0644); err != nil {
if err := os.WriteFile("AUTHORS", content.Bytes(), 0644); err != nil {
log.Fatalln(err)
}
}
Expand Down Expand Up @@ -381,7 +381,7 @@ func writeLicense(info *info) {
if err != nil {
log.Fatalf("error stat'ing %s: %v\n", info.file, err)
}
content, err := ioutil.ReadFile(info.file)
content, err := os.ReadFile(info.file)
if err != nil {
log.Fatalf("error reading %s: %v\n", info.file, err)
}
Expand All @@ -400,7 +400,7 @@ func writeLicense(info *info) {
return
}
fmt.Println("writing", info.ShortLicense(), info.file)
if err := ioutil.WriteFile(info.file, buf.Bytes(), fi.Mode()); err != nil {
if err := os.WriteFile(info.file, buf.Bytes(), fi.Mode()); err != nil {
log.Fatalf("error writing %s: %v", info.file, err)
}
}
Expand Down
12 changes: 6 additions & 6 deletions cmd/abigen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"os"
"path/filepath"
"regexp"
Expand Down Expand Up @@ -155,9 +155,9 @@ func abigen(c *cli.Context) error {
)
input := c.GlobalString(abiFlag.Name)
if input == "-" {
abi, err = ioutil.ReadAll(os.Stdin)
abi, err = io.ReadAll(os.Stdin)
} else {
abi, err = ioutil.ReadFile(input)
abi, err = os.ReadFile(input)
}
if err != nil {
utils.Fatalf("Failed to read input ABI: %v", err)
Expand All @@ -166,7 +166,7 @@ func abigen(c *cli.Context) error {

var bin []byte
if binFile := c.GlobalString(binFlag.Name); binFile != "" {
if bin, err = ioutil.ReadFile(binFile); err != nil {
if bin, err = os.ReadFile(binFile); err != nil {
utils.Fatalf("Failed to read input bytecode: %v", err)
}
if strings.Contains(string(bin), "//") {
Expand Down Expand Up @@ -213,7 +213,7 @@ func abigen(c *cli.Context) error {
}

case c.GlobalIsSet(jsonFlag.Name):
jsonOutput, err := ioutil.ReadFile(c.GlobalString(jsonFlag.Name))
jsonOutput, err := os.ReadFile(c.GlobalString(jsonFlag.Name))
if err != nil {
utils.Fatalf("Failed to read combined-json from compiler: %v", err)
}
Expand Down Expand Up @@ -267,7 +267,7 @@ func abigen(c *cli.Context) error {
fmt.Printf("%s\n", code)
return nil
}
if err := ioutil.WriteFile(c.GlobalString(outFlag.Name), []byte(code), 0600); err != nil {
if err := os.WriteFile(c.GlobalString(outFlag.Name), []byte(code), 0600); err != nil {
utils.Fatalf("Failed to write ABI binding: %v", err)
}
return nil
Expand Down
Loading
Loading