-
Notifications
You must be signed in to change notification settings - Fork 388
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(crypto/keys): in dbKeybase.writeInfo, if replacing a name entry, …
…remove the lookup by the old address (#2685) This PR fixes the bug demonstrated in #2684 : * In `dbKeybase.writeInfo`, add an `error` return and propagate this to all callers (`writeLocalKey`, etc.) . We need `writeInfo` to do some database integrity checks, so it needs to be able to return an error. * Update `dbKeybase.writeInfo` as suggested in [#2684](#2684) . If an existing name entry is being replaced with new `Info`, then remove the "lookup by address" entry for the existing address. * In `TestKeyManagement`, add a test similar to [#2684](#2684) , except that after using `CreateAccount` with the same name, expect `GetByAddress` to fail for the obsolete address and its (non-existing) public key. (This test passes.) <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [x] Provided any useful hints for running manual tests </details> Signed-off-by: Jeff Thompson <[email protected]>
- Loading branch information
Showing
2 changed files
with
51 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4b68712
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark 'Go Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
1.20
.BenchmarkBinary/EmptyStruct:encode
489.7
ns/op 96 B/op 2 allocs/op289.4
ns/op 96 B/op 2 allocs/op1.69
BenchmarkBinary/EmptyStruct:encode - ns/op
489.7
ns/op289.4
ns/op1.69
BenchmarkBinary/EmptyStruct:decode
256.8
ns/op 0 B/op 0 allocs/op135.5
ns/op 0 B/op 0 allocs/op1.90
BenchmarkBinary/EmptyStruct:decode - ns/op
256.8
ns/op135.5
ns/op1.90
BenchmarkBinary/PrimitivesStruct:encode
5020
ns/op 1724 B/op 60 allocs/op4154
ns/op 1724 B/op 60 allocs/op1.21
BenchmarkBinary/PrimitivesStruct:encode - ns/op
5020
ns/op4154
ns/op1.21
BenchmarkBinary/ShortArraysStruct:encode
769.3
ns/op 192 B/op 4 allocs/op613.8
ns/op 192 B/op 4 allocs/op1.25
BenchmarkBinary/ShortArraysStruct:encode - ns/op
769.3
ns/op613.8
ns/op1.25
BenchmarkBinary/ShortArraysStruct:decode
358.6
ns/op 0 B/op 0 allocs/op217
ns/op 0 B/op 0 allocs/op1.65
BenchmarkBinary/ShortArraysStruct:decode - ns/op
358.6
ns/op217
ns/op1.65
BenchmarkBcryptGenerateFromPassword/benchmark-security-param
63664259
ns/op 5130 B/op 9 allocs/op31921433
ns/op 5125 B/op 9 allocs/op1.99
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op
63664259
ns/op31921433
ns/op1.99
BenchmarkBcryptGenerateFromPassword/benchmark-security-param
127280015
ns/op 5139 B/op 9 allocs/op31921433
ns/op 5125 B/op 9 allocs/op3.99
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op
127280015
ns/op31921433
ns/op3.99
BenchmarkBcryptGenerateFromPassword/benchmark-security-param
254522411
ns/op 5158 B/op 9 allocs/op31921433
ns/op 5125 B/op 9 allocs/op7.97
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op
254522411
ns/op31921433
ns/op7.97
BenchmarkBcryptGenerateFromPassword/benchmark-security-param
508903738
ns/op 5196 B/op 10 allocs/op31921433
ns/op 5125 B/op 9 allocs/op15.94
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op
508903738
ns/op31921433
ns/op15.94
BenchmarkBcryptGenerateFromPassword/benchmark-security-param
1017736987
ns/op 5528 B/op 13 allocs/op31921433
ns/op 5125 B/op 9 allocs/op31.88
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op
1017736987
ns/op31921433
ns/op31.88
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - allocs/op
13
allocs/op9
allocs/op1.44
BenchmarkBcryptGenerateFromPassword/benchmark-security-param
2034850003
ns/op 5528 B/op 13 allocs/op31921433
ns/op 5125 B/op 9 allocs/op63.75
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op
2034850003
ns/op31921433
ns/op63.75
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - allocs/op
13
allocs/op9
allocs/op1.44
BenchmarkSigning
84353
ns/op 1856 B/op 36 allocs/op25716
ns/op 64 B/op 1 allocs/op3.28
BenchmarkSigning - ns/op
84353
ns/op25716
ns/op3.28
BenchmarkSigning - B/op
1856
B/op64
B/op29
BenchmarkSigning - allocs/op
36
allocs/op1
allocs/op36
BenchmarkSigning
83400
ns/op 1856 B/op 36 allocs/op25716
ns/op 64 B/op 1 allocs/op3.24
BenchmarkSigning - ns/op
83400
ns/op25716
ns/op3.24
BenchmarkSigning - B/op
1856
B/op64
B/op29
BenchmarkSigning - allocs/op
36
allocs/op1
allocs/op36
BenchmarkVerification
164516
ns/op 864 B/op 19 allocs/op61409
ns/op 0 B/op 0 allocs/op2.68
BenchmarkVerification - ns/op
164516
ns/op61409
ns/op2.68
BenchmarkVerification - B/op
864
B/op0
B/op+∞
BenchmarkVerification - allocs/op
19
allocs/op0
allocs/op+∞
BenchmarkVerification
166316
ns/op 864 B/op 19 allocs/op61409
ns/op 0 B/op 0 allocs/op2.71
BenchmarkVerification - ns/op
166316
ns/op61409
ns/op2.71
BenchmarkVerification - B/op
864
B/op0
B/op+∞
BenchmarkVerification - allocs/op
19
allocs/op0
allocs/op+∞
BenchmarkRandomBytes/random
68.9
ns/op 16 B/op 1 allocs/op32.64
ns/op 4 B/op 1 allocs/op2.11
BenchmarkRandomBytes/random - ns/op
68.9
ns/op32.64
ns/op2.11
BenchmarkRandomBytes/random - B/op
16
B/op4
B/op4
BenchmarkRandomBytes/random
104.9
ns/op 32 B/op 1 allocs/op32.64
ns/op 4 B/op 1 allocs/op3.21
BenchmarkRandomBytes/random - ns/op
104.9
ns/op32.64
ns/op3.21
BenchmarkRandomBytes/random - B/op
32
B/op4
B/op8
BenchmarkRandomBytes/random
267.6
ns/op 112 B/op 1 allocs/op32.64
ns/op 4 B/op 1 allocs/op8.20
BenchmarkRandomBytes/random - ns/op
267.6
ns/op32.64
ns/op8.20
BenchmarkRandomBytes/random - B/op
112
B/op4
B/op28
BenchmarkRandomBytes/random
2313
ns/op 1024 B/op 1 allocs/op32.64
ns/op 4 B/op 1 allocs/op70.86
BenchmarkRandomBytes/random - ns/op
2313
ns/op32.64
ns/op70.86
BenchmarkRandomBytes/random - B/op
1024
B/op4
B/op256
BenchmarkSmall/boltdb-1000-100-16-40/update
1560994
ns/op 46373 B/op 410 allocs/op957304
ns/op 37614 B/op 371 allocs/op1.63
BenchmarkSmall/boltdb-1000-100-16-40/update - ns/op
1560994
ns/op957304
ns/op1.63
BenchmarkSmall/boltdb-1000-100-16-40/update - B/op
46373
B/op37614
B/op1.23
BenchmarkSmall/memdb-1000-100-16-40/block
16019611
ns/op 9229206 B/op 168346 allocs/op11804415
ns/op 6598770 B/op 117053 allocs/op1.36
BenchmarkSmall/memdb-1000-100-16-40/block - ns/op
16019611
ns/op11804415
ns/op1.36
BenchmarkSmall/memdb-1000-100-16-40/block - B/op
9229206
B/op6598770
B/op1.40
BenchmarkSmall/memdb-1000-100-16-40/block - allocs/op
168346
allocs/op117053
allocs/op1.44
BenchmarkMedium/boltdb-100000-100-16-40/update
6822644
ns/op 129019 B/op 1005 allocs/op5451720
ns/op 100993 B/op 855 allocs/op1.25
BenchmarkMedium/boltdb-100000-100-16-40/update - ns/op
6822644
ns/op5451720
ns/op1.25
BenchmarkMedium/boltdb-100000-100-16-40/update - B/op
129019
B/op100993
B/op1.28
BenchmarkMedium/memdb-100000-100-16-40/update
1207100
ns/op 375006 B/op 7428 allocs/op989722
ns/op 265386 B/op 5131 allocs/op1.22
BenchmarkMedium/memdb-100000-100-16-40/update - ns/op
1207100
ns/op989722
ns/op1.22
BenchmarkMedium/memdb-100000-100-16-40/update - B/op
375006
B/op265386
B/op1.41
BenchmarkMedium/memdb-100000-100-16-40/update - allocs/op
7428
allocs/op5131
allocs/op1.45
BenchmarkLevelDBBatchSizes/goleveldb-100000-400-16-40/update - B/op
48967
B/op38391
B/op1.28
BenchmarkLevelDBBatchSizes/goleveldb-100000-400-16-40/update - allocs/op
590
allocs/op448
allocs/op1.32
BenchmarkLevelDBBatchSizes/goleveldb-100000-2000-16-40/update - allocs/op
440
allocs/op343
allocs/op1.28
BenchmarkLevelDBBatchSizes/goleveldb-100000-2000-16-40/block - B/op
109983514
B/op79179637
B/op1.39
BenchmarkLevelDBBatchSizes/goleveldb-100000-2000-16-40/block - allocs/op
1310480
allocs/op985549
allocs/op1.33
BenchmarkHash/ripemd160
2839
ns/op 25 B/op 1 allocs/op701.2
ns/op 25 B/op 1 allocs/op4.05
BenchmarkHash/ripemd160 - ns/op
2839
ns/op701.2
ns/op4.05
BenchmarkHash/sha2-256
521.5
ns/op 33 B/op 1 allocs/op170.7
ns/op 33 B/op 1 allocs/op3.06
BenchmarkHash/sha2-256 - ns/op
521.5
ns/op170.7
ns/op3.06
BenchmarkHash/sha3-256
1839
ns/op 33 B/op 1 allocs/op715.1
ns/op 33 B/op 1 allocs/op2.57
BenchmarkHash/sha3-256 - ns/op
1839
ns/op715.1
ns/op2.57
BenchmarkWriteSecretConnection
6597
ns/op 0 B/op 0 allocs/op4102
ns/op 0 B/op 0 allocs/op1.61
BenchmarkWriteSecretConnection - ns/op
6597
ns/op4102
ns/op1.61
BenchmarkReadSecretConnection
3938
ns/op 0 B/op 0 allocs/op2353
ns/op 0 B/op 0 allocs/op1.67
BenchmarkReadSecretConnection - ns/op
3938
ns/op2353
ns/op1.67
This comment was automatically generated by workflow using github-action-benchmark.
CC: @ajnavarro @thehowl @zivkovicmilos