mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-13 15:33:47 +00:00
fix(zktrie): copy trie properly for concurrent access (#747)
This commit is contained in:
parent
12871c7745
commit
6038ac8753
2 changed files with 2 additions and 3 deletions
|
|
@ -24,7 +24,7 @@ import (
|
||||||
const (
|
const (
|
||||||
VersionMajor = 5 // Major version component of the current release
|
VersionMajor = 5 // Major version component of the current release
|
||||||
VersionMinor = 3 // Minor version component of the current release
|
VersionMinor = 3 // Minor version component of the current release
|
||||||
VersionPatch = 15 // Patch version component of the current release
|
VersionPatch = 16 // Patch version component of the current release
|
||||||
VersionMeta = "mainnet" // Version metadata to append to the version string
|
VersionMeta = "mainnet" // Version metadata to append to the version string
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -129,8 +129,7 @@ func TestZkTrieConcurrency(t *testing.T) {
|
||||||
threads := runtime.NumCPU()
|
threads := runtime.NumCPU()
|
||||||
tries := make([]*ZkTrie, threads)
|
tries := make([]*ZkTrie, threads)
|
||||||
for i := 0; i < threads; i++ {
|
for i := 0; i < threads; i++ {
|
||||||
cpy := *trie
|
tries[i] = trie.Copy()
|
||||||
tries[i] = &cpy
|
|
||||||
}
|
}
|
||||||
// Start a batch of goroutines interactng with the trie
|
// Start a batch of goroutines interactng with the trie
|
||||||
pend := new(sync.WaitGroup)
|
pend := new(sync.WaitGroup)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue