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

add taplo CI + format all TOML files #915

Closed
wants to merge 3 commits into from

Conversation

plebhash
Copy link
Collaborator

close #914 by:

  • adding a CI step based on taplo
  • applying to all TOML files

Copy link
Contributor

github-actions bot commented May 18, 2024

🐰Bencher

ReportTue, July 9, 2024 at 14:16:59 UTC
ProjectStratum v2 (SRI)
Branchtaplo
Testbedsv2

🚨 10 ALERTS: Threshold Boundary Limits exceeded!
BenchmarkMeasure (units)ViewValueLower BoundaryUpper Boundary
client_sv2_handle_message_commonL2 Accesses (accesses)🚨 (view plot | view alert)12.00 (+65.22%)11.71 (102.47%)
client_sv2_mining_message_submit_standard_serializeL2 Accesses (accesses)🚨 (view plot | view alert)54.00 (+13.04%)53.82 (100.33%)
client_sv2_mining_message_submit_standard_serialize_deserializeInstructions (instructions)🚨 (view plot | view alert)10,585.00 (+0.38%)10,575.97 (100.09%)
client_sv2_mining_message_submit_standard_serialize_deserializeL1 Accesses (accesses)🚨 (view plot | view alert)15,400.00 (+0.36%)15,386.41 (100.09%)
client_sv2_open_channel_serializeL2 Accesses (accesses)🚨 (view plot | view alert)44.00 (+16.71%)43.41 (101.36%)
client_sv2_open_channel_serialize_deserializeInstructions (instructions)🚨 (view plot | view alert)8,027.00 (+0.50%)8,018.31 (100.11%)
client_sv2_open_channel_serialize_deserializeL1 Accesses (accesses)🚨 (view plot | view alert)11,673.00 (+0.47%)11,660.62 (100.11%)
client_sv2_setup_connectionL2 Accesses (accesses)🚨 (view plot | view alert)15.00 (+58.04%)14.88 (100.81%)
client_sv2_setup_connection_serialize_deserializeInstructions (instructions)🚨 (view plot | view alert)14,855.00 (+0.28%)14,845.89 (100.06%)
client_sv2_setup_connection_serialize_deserializeL1 Accesses (accesses)🚨 (view plot | view alert)21,812.00 (+0.26%)21,798.22 (100.06%)

Click to view all benchmark results
BenchmarkEstimated CyclesEstimated Cycles Results
estimated cycles | (Δ%)
Estimated Cycles Upper Boundary
estimated cycles | (%)
InstructionsInstructions Results
instructions | (Δ%)
Instructions Upper Boundary
instructions | (%)
L1 AccessesL1 Accesses Results
accesses | (Δ%)
L1 Accesses Upper Boundary
accesses | (%)
L2 AccessesL2 Accesses Results
accesses | (Δ%)
L2 Accesses Upper Boundary
accesses | (%)
RAM AccessesRAM Accesses Results
accesses | (Δ%)
RAM Accesses Upper Boundary
accesses | (%)
client_sv2_handle_message_common✅ (view plot)2,085.00 (+1.62%)2,128.75 (97.94%)✅ (view plot)473.00 (+0.46%)486.12 (97.30%)✅ (view plot)730.00 (-0.28%)754.50 (96.75%)🚨 (view plot | view alert)12.00 (+65.22%)11.71 (102.47%)✅ (view plot)37.00 (+0.91%)38.53 (96.03%)
client_sv2_handle_message_mining✅ (view plot)8,219.00 (+0.25%)8,334.28 (98.62%)✅ (view plot)2,137.00 (+0.43%)2,170.89 (98.44%)✅ (view plot)3,159.00 (+0.43%)3,215.21 (98.25%)✅ (view plot)39.00 (+1.14%)43.50 (89.66%)✅ (view plot)139.00 (+0.10%)141.90 (97.96%)
client_sv2_mining_message_submit_standard✅ (view plot)6,274.00 (-0.02%)6,385.22 (98.26%)✅ (view plot)1,750.00 (+0.03%)1,762.83 (99.27%)✅ (view plot)2,549.00 (-0.17%)2,575.16 (98.98%)✅ (view plot)24.00 (+33.46%)24.24 (99.01%)✅ (view plot)103.00 (-0.74%)106.80 (96.44%)
client_sv2_mining_message_submit_standard_serialize✅ (view plot)14,653.00 (-0.77%)15,027.39 (97.51%)✅ (view plot)4,694.00 (+0.01%)4,706.83 (99.73%)✅ (view plot)6,753.00 (-0.02%)6,774.63 (99.68%)🚨 (view plot | view alert)54.00 (+13.04%)53.82 (100.33%)✅ (view plot)218.00 (-1.84%)229.86 (94.84%)
client_sv2_mining_message_submit_standard_serialize_deserialize✅ (view plot)27,465.00 (-0.04%)27,832.80 (98.68%)🚨 (view plot | view alert)10,585.00 (+0.38%)10,575.97 (100.09%)🚨 (view plot | view alert)15,400.00 (+0.36%)15,386.41 (100.09%)✅ (view plot)89.00 (+5.82%)90.33 (98.53%)✅ (view plot)332.00 (-0.78%)344.95 (96.25%)
client_sv2_open_channel✅ (view plot)4,417.00 (-1.56%)4,609.11 (95.83%)✅ (view plot)1,461.00 (+0.05%)1,474.10 (99.11%)✅ (view plot)2,157.00 (+0.19%)2,172.79 (99.27%)✅ (view plot)11.00 (-7.66%)15.12 (72.76%)✅ (view plot)63.00 (-3.05%)68.15 (92.45%)
client_sv2_open_channel_serialize✅ (view plot)14,014.00 (-1.33%)14,464.50 (96.89%)✅ (view plot)5,064.00 (+0.02%)5,077.10 (99.74%)✅ (view plot)7,319.00 (+0.02%)7,338.81 (99.73%)🚨 (view plot | view alert)44.00 (+16.71%)43.41 (101.36%)✅ (view plot)185.00 (-3.31%)199.13 (92.90%)
client_sv2_open_channel_serialize_deserialize✅ (view plot)22,553.00 (-0.36%)23,010.65 (98.01%)🚨 (view plot | view alert)8,027.00 (+0.50%)8,018.31 (100.11%)🚨 (view plot | view alert)11,673.00 (+0.47%)11,660.62 (100.11%)✅ (view plot)83.00 (+12.16%)83.88 (98.95%)✅ (view plot)299.00 (-1.70%)314.78 (94.99%)
client_sv2_setup_connection✅ (view plot)4,659.00 (-0.78%)4,763.56 (97.80%)✅ (view plot)1,502.00 (+0.05%)1,515.10 (99.14%)✅ (view plot)2,274.00 (-0.12%)2,298.95 (98.91%)🚨 (view plot | view alert)15.00 (+58.04%)14.88 (100.81%)✅ (view plot)66.00 (-2.59%)69.73 (94.64%)
client_sv2_setup_connection_serialize✅ (view plot)15,942.00 (-1.85%)16,523.13 (96.48%)✅ (view plot)5,963.00 (+0.01%)5,976.10 (99.78%)✅ (view plot)8,662.00 (+0.07%)8,677.76 (99.82%)✅ (view plot)49.00 (+9.06%)49.75 (98.49%)✅ (view plot)201.00 (-4.45%)218.65 (91.93%)
client_sv2_setup_connection_serialize_deserialize✅ (view plot)35,412.00 (-0.32%)35,744.03 (99.07%)🚨 (view plot | view alert)14,855.00 (+0.28%)14,845.89 (100.06%)🚨 (view plot | view alert)21,812.00 (+0.26%)21,798.22 (100.06%)✅ (view plot)109.00 (+8.68%)114.02 (95.60%)✅ (view plot)373.00 (-1.61%)385.22 (96.83%)

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

Copy link
Contributor

github-actions bot commented May 18, 2024

🐰Bencher

ReportTue, July 9, 2024 at 14:16:47 UTC
ProjectStratum v2 (SRI)
Branchtaplo
Testbedsv1
Click to view all benchmark results
BenchmarkEstimated CyclesEstimated Cycles Results
estimated cycles | (Δ%)
Estimated Cycles Upper Boundary
estimated cycles | (%)
InstructionsInstructions Results
instructions | (Δ%)
Instructions Upper Boundary
instructions | (%)
L1 AccessesL1 Accesses Results
accesses | (Δ%)
L1 Accesses Upper Boundary
accesses | (%)
L2 AccessesL2 Accesses Results
accesses | (Δ%)
L2 Accesses Upper Boundary
accesses | (%)
RAM AccessesRAM Accesses Results
accesses | (Δ%)
RAM Accesses Upper Boundary
accesses | (%)
get_authorize✅ (view plot)8,504.00 (+0.76%)8,722.87 (97.49%)✅ (view plot)3,746.00 (+0.14%)3,852.86 (97.23%)✅ (view plot)5,249.00 (+0.07%)5,398.02 (97.24%)✅ (view plot)7.00 (-11.35%)10.32 (67.80%)✅ (view plot)92.00 (+2.07%)94.13 (97.74%)
get_submit✅ (view plot)95,475.00 (-0.08%)96,124.36 (99.32%)✅ (view plot)59,439.00 (-0.05%)59,769.89 (99.45%)✅ (view plot)85,360.00 (-0.05%)85,824.35 (99.46%)✅ (view plot)49.00 (-10.49%)62.73 (78.12%)✅ (view plot)282.00 (-0.03%)287.55 (98.07%)
get_subscribe✅ (view plot)7,957.00 (-0.23%)8,262.10 (96.31%)✅ (view plot)2,841.00 (+0.37%)2,937.79 (96.71%)✅ (view plot)3,972.00 (+0.44%)4,097.32 (96.94%)✅ (view plot)13.00 (-18.31%)20.19 (64.37%)✅ (view plot)112.00 (-0.54%)116.81 (95.89%)
serialize_authorize✅ (view plot)12,257.00 (+0.39%)12,499.34 (98.06%)✅ (view plot)5,317.00 (+0.10%)5,423.86 (98.03%)✅ (view plot)7,412.00 (+0.06%)7,561.36 (98.02%)✅ (view plot)10.00 (-7.05%)13.30 (75.20%)✅ (view plot)137.00 (+1.00%)140.23 (97.69%)
serialize_deserialize_authorize✅ (view plot)24,554.00 (+0.33%)24,710.50 (99.37%)✅ (view plot)9,898.00 (-0.02%)10,023.10 (98.75%)✅ (view plot)13,959.00 (-0.05%)14,146.32 (98.68%)✅ (view plot)33.00 (-9.33%)41.57 (79.38%)✅ (view plot)298.00 (+1.01%)298.28 (99.91%)
serialize_deserialize_handle_authorize✅ (view plot)30,293.00 (+0.45%)30,365.62 (99.76%)✅ (view plot)12,101.00 (+0.04%)12,207.86 (99.12%)✅ (view plot)17,118.00 (+0.00%)17,276.13 (99.08%)✅ (view plot)59.00 (+0.44%)64.51 (91.46%)✅ (view plot)368.00 (+1.06%)368.15 (99.96%)
serialize_deserialize_handle_submit✅ (view plot)126,372.00 (-0.03%)127,015.66 (99.49%)✅ (view plot)73,224.00 (-0.03%)73,610.22 (99.48%)✅ (view plot)104,947.00 (-0.04%)105,497.66 (99.48%)✅ (view plot)120.00 (-0.36%)130.96 (91.63%)✅ (view plot)595.00 (+0.02%)599.18 (99.30%)
serialize_deserialize_handle_subscribe✅ (view plot)27,457.00 (+0.00%)27,600.95 (99.48%)✅ (view plot)9,643.00 (+0.11%)9,739.79 (99.01%)✅ (view plot)13,642.00 (+0.13%)13,772.88 (99.05%)✅ (view plot)61.00 (-7.11%)73.64 (82.84%)✅ (view plot)386.00 (+0.04%)388.60 (99.33%)
serialize_deserialize_submit✅ (view plot)114,999.00 (-0.07%)115,636.41 (99.45%)✅ (view plot)68,001.00 (-0.08%)68,392.72 (99.43%)✅ (view plot)97,559.00 (-0.09%)98,135.94 (99.41%)✅ (view plot)65.00 (-6.01%)75.40 (86.21%)✅ (view plot)489.00 (+0.17%)492.34 (99.32%)
serialize_deserialize_subscribe✅ (view plot)22,888.00 (+0.06%)23,105.99 (99.06%)✅ (view plot)8,195.00 (+0.11%)8,295.34 (98.79%)✅ (view plot)11,543.00 (+0.11%)11,680.00 (98.83%)✅ (view plot)36.00 (-8.10%)44.17 (81.50%)✅ (view plot)319.00 (+0.14%)321.45 (99.24%)
serialize_submit✅ (view plot)99,792.00 (-0.10%)100,452.60 (99.34%)✅ (view plot)61,483.00 (-0.05%)61,819.14 (99.46%)✅ (view plot)88,207.00 (-0.05%)88,677.71 (99.47%)✅ (view plot)49.00 (-11.41%)62.66 (78.20%)✅ (view plot)324.00 (-0.20%)329.05 (98.47%)
serialize_subscribe✅ (view plot)11,294.00 (-0.27%)11,598.08 (97.38%)✅ (view plot)4,188.00 (+0.25%)4,284.79 (97.74%)✅ (view plot)5,829.00 (+0.28%)5,956.42 (97.86%)✅ (view plot)15.00 (-7.35%)19.17 (78.23%)✅ (view plot)154.00 (-0.74%)159.62 (96.48%)

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

Copy link
Contributor

github-actions bot commented May 18, 2024

🐰Bencher

ReportTue, July 9, 2024 at 14:16:48 UTC
ProjectStratum v2 (SRI)
Branchtaplo
Testbedsv2

🚨 1 ALERT: Threshold Boundary Limit exceeded!
BenchmarkMeasure (units)ViewValueLower BoundaryUpper Boundary
client_sv2_handle_message_commonLatency (nanoseconds (ns))🚨 (view plot | view alert)46.92 (+5.19%)45.54 (103.03%)

Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Upper Boundary
nanoseconds (ns) | (%)
client_sv2_handle_message_common🚨 (view plot | view alert)46.92 (+5.19%)45.54 (103.03%)
client_sv2_handle_message_mining✅ (view plot)72.57 (-0.47%)80.27 (90.40%)
client_sv2_mining_message_submit_standard✅ (view plot)14.65 (-0.01%)14.71 (99.63%)
client_sv2_mining_message_submit_standard_serialize✅ (view plot)259.79 (-1.75%)283.84 (91.53%)
client_sv2_mining_message_submit_standard_serialize_deserialize✅ (view plot)595.49 (+0.10%)628.11 (94.81%)
client_sv2_open_channel✅ (view plot)173.22 (+4.16%)174.07 (99.51%)
client_sv2_open_channel_serialize✅ (view plot)271.53 (-3.81%)294.16 (92.31%)
client_sv2_open_channel_serialize_deserialize✅ (view plot)371.89 (-1.68%)422.71 (87.98%)
client_sv2_setup_connection✅ (view plot)164.24 (-0.02%)175.21 (93.74%)
client_sv2_setup_connection_serialize✅ (view plot)447.45 (-5.27%)507.17 (88.22%)
client_sv2_setup_connection_serialize_deserialize✅ (view plot)970.35 (-0.02%)1,037.10 (93.56%)

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

Copy link
Contributor

github-actions bot commented May 18, 2024

🐰Bencher

ReportTue, July 9, 2024 at 14:16:08 UTC
ProjectStratum v2 (SRI)
Branch915/merge
Testbedsv1

🚨 1 ALERT: Threshold Boundary Limit exceeded!
BenchmarkMeasure (units)ViewValueLower BoundaryUpper Boundary
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handleLatency (nanoseconds (ns))🚨 (view plot | view alert)794.49 (+5.88%)786.25 (101.05%)

Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Upper Boundary
nanoseconds (ns) | (%)
client-submit-serialize✅ (view plot)6,498.70 (-5.80%)7,359.80 (88.30%)
client-submit-serialize-deserialize✅ (view plot)7,467.20 (-4.42%)8,348.05 (89.45%)
client-submit-serialize-deserialize-handle/client-submit-serialize-deserialize-handle✅ (view plot)8,041.20 (-4.08%)8,857.22 (90.79%)
client-sv1-authorize-serialize-deserialize-handle/client-sv1-authorize-serialize-deserialize-handle✅ (view plot)906.05 (+0.77%)926.64 (97.78%)
client-sv1-authorize-serialize-deserialize/client-sv1-authorize-serialize-deserialize✅ (view plot)716.37 (+2.67%)718.83 (99.66%)
client-sv1-authorize-serialize/client-sv1-authorize-serialize✅ (view plot)248.99 (+0.36%)254.94 (97.67%)
client-sv1-get-authorize/client-sv1-get-authorize✅ (view plot)156.38 (-0.52%)162.31 (96.35%)
client-sv1-get-submit✅ (view plot)6,292.50 (-5.51%)7,157.95 (87.91%)
client-sv1-get-subscribe/client-sv1-get-subscribe✅ (view plot)278.57 (-0.09%)291.11 (95.69%)
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handle🚨 (view plot | view alert)794.49 (+5.88%)786.25 (101.05%)
client-sv1-subscribe-serialize-deserialize/client-sv1-subscribe-serialize-deserialize✅ (view plot)634.72 (+3.24%)638.32 (99.44%)
client-sv1-subscribe-serialize/client-sv1-subscribe-serialize✅ (view plot)209.94 (+1.65%)219.50 (95.64%)

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

@pavlenex pavlenex added this to the 1.0.2 milestone May 20, 2024
@pavlenex pavlenex linked an issue May 20, 2024 that may be closed by this pull request
@plebhash plebhash force-pushed the taplo branch 2 times, most recently from 523a16e to d64ed78 Compare June 4, 2024 00:50
@plebhash plebhash requested a review from rrybarczyk June 14, 2024 15:37
@jbesraa

This comment was marked as outdated.

@plebhash

This comment was marked as outdated.

rrybarczyk

This comment was marked as resolved.

@plebhash plebhash force-pushed the taplo branch 2 times, most recently from e3f62da to dcd231f Compare June 25, 2024 14:45
@plebhash

This comment was marked as resolved.

rrybarczyk

This comment was marked as outdated.

@plebhash

This comment was marked as outdated.

Copy link
Contributor

@jbesraa jbesraa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not really convinced about formatting Cargo.toml files. As long as they are not huge, the normal formatting is just fine. whats the motivation for including them here?

@plebhash
Copy link
Collaborator Author

plebhash commented Jul 3, 2024

I am not really convinced about formatting Cargo.toml files. As long as they are not huge, the normal formatting is just fine. whats the motivation for including them here?

original motivation was just to bring some uniformity to them... there's random patterns accross multiple files

but also, if we include taplo on CI, we need all TOML files to conform to those rules, otherwise CI will break for every PR

@jbesraa
Copy link
Contributor

jbesraa commented Jul 3, 2024

I am not really convinced about formatting Cargo.toml files. As long as they are not huge, the normal formatting is just fine. whats the motivation for including them here?

original motivation was just to bring some uniformity to them... there's random patterns accross multiple files

but also, if we include taplo on CI, we need all TOML files to conform to those rules, otherwise CI will break for every PR

I think if you are eager to format Cargo.toml files, the formatting should at least follow the original formatting. i.e., similar to what cargo produces when creating new crate.

Cant taplo exclude files?

@plebhash

This comment was marked as outdated.

@rrybarczyk

This comment was marked as resolved.

@rrybarczyk

This comment was marked as resolved.

@plebhash plebhash force-pushed the taplo branch 2 times, most recently from 4d20fed to 7086871 Compare July 5, 2024 22:17
@plebhash

This comment was marked as outdated.

@jbesraa
Copy link
Contributor

jbesraa commented Jul 8, 2024

@jbesraa I removed .taplo.toml with the opinionated formatting from the PR

now, we are just doing the default formatting

You can exclude Cargo.toml from taplo, see this https://taplo.tamasfe.dev/configuration/file.html#exclude.
There example is exactly what we want: you specify which folder you want to include in the include prop and in exclude you ignore files from the included stuff.

Edit: My main concern here is that we are using the same CI process + same formatting setup for a config intended for users and a config(Cargo.toml) we use, requirements between those two could diverge easily

@plebhash plebhash force-pushed the taplo branch 2 times, most recently from 7c4455f to 39b4218 Compare July 8, 2024 19:55
@plebhash
Copy link
Collaborator Author

plebhash commented Jul 8, 2024

My main concern here is that we are using the same CI process + same formatting setup for a config intended for users and a config(Cargo.toml) we use, requirements between those two could diverge easily

I rebased. Now we have three separate taplo config files, each applying to specific categories of TOML files.

They don't have any specific formatting policies however, only inlcude/exclude filters.

@jbesraa do you have any specific ideas on formatting policies, or did you just want to make this PR "future-proof" in that sense?

Copy link
Contributor

@jbesraa jbesraa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New approach looks good.

In the future it would be good to move all the configs to a folder in root, not sure they should live in the crate itself

serde_json = { version = "1.0.64", default-features = false, features = ["alloc"] }
tracing = {version = "0.1"}
binary_sv2 = { version = "^1.0.0", path = "../v2/binary-sv2/binary-sv2"}
serde = { version = "1.0.89", default-features = false, features = [
Copy link
Contributor

@jbesraa jbesraa Jul 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line break because of line length? the previous formatting made more sense(each crate on its own line)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, the .taplo*.toml files are all empty with regards to actual formatting policies, they only do filtering for which file they will format

so I assume this is coming from the default formatting policy that taplo brings

@plebhash plebhash force-pushed the taplo branch 4 times, most recently from 91dfedf to b8d0034 Compare July 9, 2024 14:06
@plebhash
Copy link
Collaborator Author

plebhash commented Jul 10, 2024

I'm reverting this back to Draft status

merging this will have an undesired impact on our semver checking on CI, see this comment for more details: #985 (comment)

we should get #985 sorted out before merging this

@pavlenex we can remove this from milestone 1.0.2, since #985 could take a while and we don't want the next release blocked

@plebhash plebhash marked this pull request as draft July 10, 2024 20:48
@pavlenex pavlenex modified the milestones: 1.0.2, 1.0.3 Jul 16, 2024
@plebhash plebhash changed the base branch from dev to main August 28, 2024 20:18
@rrybarczyk
Copy link
Collaborator

Maybe someday.

@rrybarczyk rrybarczyk closed this Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/cd CI/CD
Projects
Status: Done ✅
Development

Successfully merging this pull request may close these issues.

formatting on TOML files
4 participants