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

Bloom filter acceleration for deposit processing #5982

Merged
merged 1 commit into from
Mar 7, 2024
Merged

Bloom filter acceleration for deposit processing #5982

merged 1 commit into from
Mar 7, 2024

Conversation

tersec
Copy link
Contributor

@tersec tersec commented Feb 27, 2024

Inspired by #5212

This takes ~10ms on my laptop to construct such a Bloom filter from 1.5M random pubkeys, and the crossover point for where it's as fast to build-then-check then just linearly check each time is about 3 deposits/block.

Since blocks are typically 0 or 16 (with one edge case at the end of each burst), this is reasonable.

@tersec
Copy link
Contributor Author

tersec commented Feb 27, 2024

Run problematic_files=()
The following files do not have '{.push raises: [].}':
- tests/consensus_spec/altair/test_fixture_operations.nim
- tests/consensus_spec/bellatrix/test_fixture_operations.nim
- tests/consensus_spec/capella/test_fixture_operations.nim
- tests/consensus_spec/deneb/test_fixture_operations.nim
- tests/consensus_spec/phase0/test_fixture_operations.nim
See https://status-im.github.io/nim-style-guide/errors.exceptions.html
Error: Process completed with exit code 2.

CI linting has issues with this.

Leaving for now not to distract from core PR, since it's not yet mergeable anyway.

@tersec tersec marked this pull request as draft February 27, 2024 18:04
@etan-status
Copy link
Contributor

@tersec tersec marked this pull request as ready for review February 29, 2024 02:00
Copy link

github-actions bot commented Feb 29, 2024

Unit Test Results

         9 files  ±0    1 110 suites  +3   23m 28s ⏱️ - 4m 18s
  4 235 tests +2    3 888 ✔️ +2  347 💤 ±0  0 ±0 
16 900 runs  +6  16 502 ✔️ +6  398 💤 ±0  0 ±0 

Results for commit 130e691. ± Comparison against base commit 9fda162.

♻️ This comment has been updated with latest results.

@tersec tersec merged commit 816361e into unstable Mar 7, 2024
13 checks passed
@tersec tersec deleted the n4A branch March 7, 2024 23:38
@tersec
Copy link
Contributor Author

tersec commented Mar 9, 2024

Checking across the 30 testing fleet Holesky hosts, comparing stable and unstable, with deposits and without deposits, during one of the deposit bursts after the unstable ones got updated to include this PR:

for el in neth geth erigon; do for i in $(seq -w 1 10); do ssh $el-$i.ih-eu-mda1.nimbus.holesky "zgrep 'Block resolved.*deposits_len' ${NODE_LOGS}/service.20240309_1000.log.gz | grep ,.deposits_len.:0, | jq .stateVer
ifyDur.value" | datamash count 1 mean 1 q1 1 median 1 q3 1; done; done

When there are deposits, stateVerifyDur is about 15%, or average of 80ms per block, faster, across hosts from stable:

66	484323114.04545	467141855.75	493183285.5	505668474.5
65	491587976.61538	480303722	495810147	512990358
65	487633510.90769	471478444	496394359	512924113
65	496337676.92308	477624745	501129420	510909702
65	493211738.33846	477230499	499544143	513895474
65	488692266.15385	473211211	499828189	508588246
64	538930085.84375	517538091.25	554958123.5	567734684
64	494797669.67188	479758027.25	500375810	512402150
63	472296654.63492	450693852	480273226	496316865
62	460766805.20968	446236848	460588344	480036399.75
66	480858032.81818	452311273.5	491502394.5	513531908.75
65	482495999.6	464537895	487782780	509172886
65	483319582.23077	468195876	492993535	504495019
65	487494226.63077	471300763	497605642	509606931
65	480067049.38462	466296981	486644149	500061842
65	497484252.04615	488163085	504365196	514383102
65	472466622.75385	449038374	482770237	498576327
64	487314524.57812	463912104.75	493138443	510793532.5
63	488589744.42857	471072446.5	493637743	509319578
62	463963564.43548	447007017.75	460288672.5	485229292
66	477890660.77273	459681253.25	478905378.5	503546266.75
65	475954171.35385	457299163	471989506	506278229
65	477154533.15385	455709599	483382665	500679008
65	483824878.26154	473140298	487187939	498482109
65	472527856.89231	452506728	479043342	499223067
65	485055584.36923	465229969	493913046	509532264
65	478576290.26154	467319158	483116541	494896556
64	483987663.60938	474069949.5	492482244	501543202.5
64	471221990.95312	454528683	473425598.5	496331850
66	431858723.07576	424685974	430267823	445195074

to unstable with this PR:

64	410410971.03125	374093233	409051894	446452720
62	417164345.24194	395658046.5	418570289.5	442945641.25
63	409810213.09524	378530719.5	403951321	445570964
62	416552912.93548	385312686	419382188.5	440970233
63	420740217.36508	396500826.5	417726121	449190692
62	420160962.58065	391672826.25	418276818.5	450001699.25
62	445997379.62903	399321551.25	453398012	496394280.75
62	415128772.98387	385790961.25	414245617.5	442619258.5
59	407027175.30508	384323325	406381493	436104223.5
56	384771033.16071	355995962	376167013.5	414956276.25
64	414842403.01562	383234664.75	414563070	445029738.25
62	419674284.46774	399199360.75	416100251.5	443744474.25
63	407428380	381778944	404498723	436183379
63	422313205.7619	401893545	421270922	445163950.5
62	404549008.80645	381738489.25	404216973	429722107.25
62	417039686.27419	390602478.75	414465568.5	447209438.25
62	405789514.64516	378545503.75	408563526.5	428575920.25
62	415645789.43548	391870179.75	413161603.5	441105460.5
59	416995735.27119	393755707	414282977	446738606.5
58	394384793.82759	360361171.5	389294379.5	430041761.75
64	401665152.84375	369053030.5	403887344	430637565.75
62	404307952.8871	378830185	397589549.5	434827350.75
62	398923952.08065	373209394.5	391169078	430545323.25
62	403499180.29032	377653985.25	403792855	423849097
62	397401894.30645	364796025.75	391999401	435353247
62	405931340.41935	377913837	405644848.5	434693448.5
62	402504020.48387	374090743.25	406562534.5	426480054.75
62	410297009.14516	381735511	405334847.5	439913003.5
59	365542397.45763	347003838	363815022	384848392.5

By comparison, without deposits, timtings for stateVerifyDur are in noise level:

214	62441289.64486	60528143	61877587	63271085.25
215	63266464.362791	60185109.5	61958953	63969361
215	62981121.688372	60456819	61986587	63630533
215	62353550.962791	60354459	61844416	62907122
215	63283898.967442	60420830	61938333	63559479.5
215	62554298.344186	60421530	61915309	63761514.5
216	62303521.638889	60018263.5	61622631.5	63632621.5
216	61920926.587963	60051395	61822821	63237748.5
217	62986048.852535	59757583	61767924	63774711
218	60740865.912844	58280598.25	59854252.5	61616409.75
214	62419975.401869	60667562	61930051	63357624.25
215	62813600.618605	60966723.5	62223017	63874870
215	59558596.916279	57473184	58738564	60273274
215	62655098.097674	60789411	62058049	63468017.5
215	58700019.576744	57245176	58448435	59423650
215	62678455.893023	60600160.5	62203665	63612481
215	60150504.716279	57608496.5	58832852	60893422.5
216	62626921.726852	60643235.5	62100569	63907328
217	61679054.520737	59287982	61282987	63017249
218	62470991.233945	59655667.5	61472337	63730368.25
214	62163380.299065	59811238.5	61343327	63044116.25
215	62074342.623256	59752237.5	61252071	63301896
215	62129200.497674	60066678	61325125	62923419
215	62203657.590698	59542379.5	61373594	63154431.5
215	60347850.232558	57826933.5	59437803	61312977.5
215	62287574.818605	59865358	61621891	63483258.5
216	62213481.439815	60033571.5	61414870	63125494.5
216	61957833.398148	59647894	61338255.5	63143018.75
216	61942540.467593	59425387.75	61124748.5	63198177
214	60192816.271028	58173033.25	59962388	61742737

for stable, with

214	62441289.64486	60528143	61877587	63271085.25
215	63266464.362791	60185109.5	61958953	63969361
215	62981121.688372	60456819	61986587	63630533
215	62353550.962791	60354459	61844416	62907122
215	63283898.967442	60420830	61938333	63559479.5
215	62554298.344186	60421530	61915309	63761514.5
216	62303521.638889	60018263.5	61622631.5	63632621.5
216	61920926.587963	60051395	61822821	63237748.5
217	62986048.852535	59757583	61767924	63774711
218	60740865.912844	58280598.25	59854252.5	61616409.75
214	62419975.401869	60667562	61930051	63357624.25
215	62813600.618605	60966723.5	62223017	63874870
215	59558596.916279	57473184	58738564	60273274
215	62655098.097674	60789411	62058049	63468017.5
215	58700019.576744	57245176	58448435	59423650
215	62678455.893023	60600160.5	62203665	63612481
215	60150504.716279	57608496.5	58832852	60893422.5
216	62626921.726852	60643235.5	62100569	63907328
217	61679054.520737	59287982	61282987	63017249
218	62470991.233945	59655667.5	61472337	63730368.25
214	62163380.299065	59811238.5	61343327	63044116.25
215	62074342.623256	59752237.5	61252071	63301896
215	62129200.497674	60066678	61325125	62923419
215	62203657.590698	59542379.5	61373594	63154431.5
215	60347850.232558	57826933.5	59437803	61312977.5
215	62287574.818605	59865358	61621891	63483258.5
216	62213481.439815	60033571.5	61414870	63125494.5
216	61957833.398148	59647894	61338255.5	63143018.75
216	61942540.467593	59425387.75	61124748.5	63198177
214	60192816.271028	58173033.25	59962388	61742737

for unstable, so the difference is concentrated in the deposit processing aspect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants