Merge tag 'v1.10.9' into develop

Notes: the AppendAncient plugin hook is broken by this commit.

This adds CaptureEnter() and CaptureExit() as no-ops for interface
compliance, but these capabilities should be added for plugin tracers
soon.
This commit is contained in:
Austin Roberts
2021-10-18 12:02:35 -05:00
296 changed files with 15843 additions and 2454 deletions
+1
View File
@@ -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 gofuzz
// +build gofuzz
package bls
+1 -1
View File
@@ -173,7 +173,7 @@ func (f *fuzzer) fuzz() int {
return 0
}
// Flush trie -> database
rootA, err := trieA.Commit(nil)
rootA, _, err := trieA.Commit(nil)
if err != nil {
panic(err)
}
+7 -7
View File
@@ -69,7 +69,7 @@ func newDataSource(input []byte) *dataSource {
input, bytes.NewReader(input),
}
}
func (ds *dataSource) ReadByte() byte {
func (ds *dataSource) readByte() byte {
if b, err := ds.reader.ReadByte(); err != nil {
return 0
} else {
@@ -89,22 +89,22 @@ func Generate(input []byte) randTest {
r := newDataSource(input)
genKey := func() []byte {
if len(allKeys) < 2 || r.ReadByte() < 0x0f {
if len(allKeys) < 2 || r.readByte() < 0x0f {
// new key
key := make([]byte, r.ReadByte()%50)
key := make([]byte, r.readByte()%50)
r.Read(key)
allKeys = append(allKeys, key)
return key
}
// use existing key
return allKeys[int(r.ReadByte())%len(allKeys)]
return allKeys[int(r.readByte())%len(allKeys)]
}
var steps randTest
for i := 0; !r.Ended(); i++ {
step := randTestStep{op: int(r.ReadByte()) % opMax}
step := randTestStep{op: int(r.readByte()) % opMax}
switch step.op {
case opUpdate:
step.key = genKey()
@@ -162,11 +162,11 @@ func runRandTest(rt randTest) error {
rt[i].err = fmt.Errorf("mismatch for key 0x%x, got 0x%x want 0x%x", step.key, v, want)
}
case opCommit:
_, rt[i].err = tr.Commit(nil)
_, _, rt[i].err = tr.Commit(nil)
case opHash:
tr.Hash()
case opReset:
hash, err := tr.Commit(nil)
hash, _, err := tr.Commit(nil)
if err != nil {
return err
}
+2 -1
View File
@@ -42,6 +42,7 @@ func TestState(t *testing.T) {
// Very time consuming
st.skipLoad(`^stTimeConsuming/`)
st.skipLoad(`.*vmPerformance/loop.*`)
// Uses 1GB RAM per tested fork
st.skipLoad(`^stStaticCall/static_Call1MB`)
@@ -114,7 +115,7 @@ func withTrace(t *testing.T, gasLimit uint64, test func(vm.Config) error) {
}
buf := new(bytes.Buffer)
w := bufio.NewWriter(buf)
tracer := vm.NewJSONLogger(&vm.LogConfig{DisableMemory: true}, w)
tracer := vm.NewJSONLogger(&vm.LogConfig{}, w)
config.Debug, config.Tracer = true, tracer
err2 := test(config)
if !reflect.DeepEqual(err, err2) {