Skip to content
This repository was archived by the owner on May 21, 2024. It is now read-only.

Commit 5663c38

Browse files
authored
Merge pull request #35 from makerdao/upgrade/v1.10.23
Upgrade/v1.10.23
2 parents 8ffa204 + 1a87e53 commit 5663c38

File tree

232 files changed

+3658
-2490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+3658
-2490
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ COPY go.sum /go-ethereum/
1414
RUN cd /go-ethereum && go mod download
1515

1616
ADD . /go-ethereum
17-
RUN cd /go-ethereum && go run build/ci.go install ./cmd/geth
17+
RUN cd /go-ethereum && go run build/ci.go install -static ./cmd/geth
1818

1919
# Pull Geth into a second stage deploy alpine container
2020
FROM alpine:latest

Dockerfile.alltools

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ COPY go.sum /go-ethereum/
1414
RUN cd /go-ethereum && go mod download
1515

1616
ADD . /go-ethereum
17-
RUN cd /go-ethereum && go run build/ci.go install
17+
RUN cd /go-ethereum && go run build/ci.go install -static
1818

1919
# Pull all binaries into a second stage deploy alpine container
2020
FROM alpine:latest

accounts/abi/abi.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func (abi ABI) getArguments(name string, data []byte) (Arguments, error) {
9595
args = event.Inputs
9696
}
9797
if args == nil {
98-
return nil, errors.New("abi: could not locate named method or event")
98+
return nil, fmt.Errorf("abi: could not locate named method or event: %s", name)
9999
}
100100
return args, nil
101101
}

accounts/abi/bind/backends/simulated.go

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ type SimulatedBackend struct {
6868
pendingState *state.StateDB // Currently pending state that will be the active on request
6969
pendingReceipts types.Receipts // Currently receipts for the pending block
7070

71-
events *filters.EventSystem // Event system for filtering log events live
71+
events *filters.EventSystem // for filtering log events live
72+
filterSystem *filters.FilterSystem // for filtering database logs
7273

7374
config *params.ChainConfig
7475
}
@@ -86,7 +87,11 @@ func NewSimulatedBackendWithDatabase(database ethdb.Database, alloc core.Genesis
8687
blockchain: blockchain,
8788
config: genesis.Config,
8889
}
89-
backend.events = filters.NewEventSystem(&filterBackend{database, blockchain, backend}, false)
90+
91+
filterBackend := &filterBackend{database, blockchain, backend}
92+
backend.filterSystem = filters.NewFilterSystem(filterBackend, filters.Config{})
93+
backend.events = filters.NewEventSystem(backend.filterSystem, false)
94+
9095
backend.rollback(blockchain.CurrentBlock())
9196
return backend
9297
}
@@ -609,7 +614,7 @@ func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallM
609614
// User specified the legacy gas field, convert to 1559 gas typing
610615
call.GasFeeCap, call.GasTipCap = call.GasPrice, call.GasPrice
611616
} else {
612-
// User specified 1559 gas feilds (or none), use those
617+
// User specified 1559 gas fields (or none), use those
613618
if call.GasFeeCap == nil {
614619
call.GasFeeCap = new(big.Int)
615620
}
@@ -689,7 +694,7 @@ func (b *SimulatedBackend) FilterLogs(ctx context.Context, query ethereum.Filter
689694
var filter *filters.Filter
690695
if query.BlockHash != nil {
691696
// Block filter requested, construct a single-shot filter
692-
filter = filters.NewBlockFilter(&filterBackend{b.database, b.blockchain, b}, *query.BlockHash, query.Addresses, query.Topics)
697+
filter = b.filterSystem.NewBlockFilter(*query.BlockHash, query.Addresses, query.Topics)
693698
} else {
694699
// Initialize unset filter boundaries to run from genesis to chain head
695700
from := int64(0)
@@ -701,7 +706,7 @@ func (b *SimulatedBackend) FilterLogs(ctx context.Context, query ethereum.Filter
701706
to = query.ToBlock.Int64()
702707
}
703708
// Construct the range filter
704-
filter = filters.NewRangeFilter(&filterBackend{b.database, b.blockchain, b}, from, to, query.Addresses, query.Topics)
709+
filter = b.filterSystem.NewRangeFilter(from, to, query.Addresses, query.Topics)
705710
}
706711
// Run the filter and return all the logs
707712
logs, err := filter.Logs(ctx)
@@ -827,7 +832,8 @@ type filterBackend struct {
827832
backend *SimulatedBackend
828833
}
829834

830-
func (fb *filterBackend) ChainDb() ethdb.Database { return fb.db }
835+
func (fb *filterBackend) ChainDb() ethdb.Database { return fb.db }
836+
831837
func (fb *filterBackend) EventMux() *event.TypeMux { panic("not supported") }
832838

833839
func (fb *filterBackend) HeaderByNumber(ctx context.Context, block rpc.BlockNumber) (*types.Header, error) {
@@ -853,19 +859,8 @@ func (fb *filterBackend) GetReceipts(ctx context.Context, hash common.Hash) (typ
853859
return rawdb.ReadReceipts(fb.db, hash, *number, fb.bc.Config()), nil
854860
}
855861

856-
func (fb *filterBackend) GetLogs(ctx context.Context, hash common.Hash) ([][]*types.Log, error) {
857-
number := rawdb.ReadHeaderNumber(fb.db, hash)
858-
if number == nil {
859-
return nil, nil
860-
}
861-
receipts := rawdb.ReadReceipts(fb.db, hash, *number, fb.bc.Config())
862-
if receipts == nil {
863-
return nil, nil
864-
}
865-
logs := make([][]*types.Log, len(receipts))
866-
for i, receipt := range receipts {
867-
logs[i] = receipt.Logs
868-
}
862+
func (fb *filterBackend) GetLogs(ctx context.Context, hash common.Hash, number uint64) ([][]*types.Log, error) {
863+
logs := rawdb.ReadLogs(fb.db, hash, number, fb.bc.Config())
869864
return logs, nil
870865
}
871866

accounts/abi/reflect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func mustArrayToByteSlice(value reflect.Value) reflect.Value {
9999
func set(dst, src reflect.Value) error {
100100
dstType, srcType := dst.Type(), src.Type()
101101
switch {
102-
case dstType.Kind() == reflect.Interface && dst.Elem().IsValid():
102+
case dstType.Kind() == reflect.Interface && dst.Elem().IsValid() && (dst.Elem().Type().Kind() == reflect.Ptr || dst.Elem().CanSet()):
103103
return set(dst.Elem(), src)
104104
case dstType.Kind() == reflect.Ptr && dstType.Elem() != reflect.TypeOf(big.Int{}):
105105
return set(dst.Elem(), src)

accounts/abi/reflect_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type reflectTest struct {
3232

3333
var reflectTests = []reflectTest{
3434
{
35-
name: "OneToOneCorrespondance",
35+
name: "OneToOneCorrespondence",
3636
args: []string{"fieldA"},
3737
struc: struct {
3838
FieldA int `abi:"fieldA"`

accounts/abi/unpack_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,11 @@ func TestMethodMultiReturn(t *testing.T) {
352352
&[]interface{}{&expected.Int, &expected.String},
353353
"",
354354
"Can unpack into a slice",
355+
}, {
356+
&[]interface{}{&bigint, ""},
357+
&[]interface{}{&expected.Int, expected.String},
358+
"",
359+
"Can unpack into a slice without indirection",
355360
}, {
356361
&[2]interface{}{&bigint, new(string)},
357362
&[2]interface{}{&expected.Int, &expected.String},

accounts/keystore/account_cache_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ func waitForAccounts(wantAccounts []accounts.Account, ks *KeyStore) error {
318318
func TestUpdatedKeyfileContents(t *testing.T) {
319319
t.Parallel()
320320

321-
// Create a temporary kesytore to test with
321+
// Create a temporary keystore to test with
322322
rand.Seed(time.Now().UnixNano())
323323
dir := filepath.Join(os.TempDir(), fmt.Sprintf("eth-keystore-updatedkeyfilecontents-test-%d-%d", os.Getpid(), rand.Int()))
324324
ks := NewKeyStore(dir, LightScryptN, LightScryptP)

accounts/keystore/file_cache.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type fileCache struct {
3939
func (fc *fileCache) scan(keyDir string) (mapset.Set, mapset.Set, mapset.Set, error) {
4040
t0 := time.Now()
4141

42-
// List all the failes from the keystore folder
42+
// List all the files from the keystore folder
4343
files, err := os.ReadDir(keyDir)
4444
if err != nil {
4545
return nil, nil, nil, err
@@ -61,7 +61,7 @@ func (fc *fileCache) scan(keyDir string) (mapset.Set, mapset.Set, mapset.Set, er
6161
log.Trace("Ignoring file on account scan", "path", path)
6262
continue
6363
}
64-
// Gather the set of all and fresly modified files
64+
// Gather the set of all and freshly modified files
6565
all.Add(path)
6666

6767
info, err := fi.Info()

accounts/keystore/keystore_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func TestSignRace(t *testing.T) {
214214
// Tests that the wallet notifier loop starts and stops correctly based on the
215215
// addition and removal of wallet event subscriptions.
216216
func TestWalletNotifierLifecycle(t *testing.T) {
217-
// Create a temporary kesytore to test with
217+
// Create a temporary keystore to test with
218218
_, ks := tmpKeyStore(t, false)
219219

220220
// Ensure that the notification updater is not running yet

0 commit comments

Comments
 (0)