0xPolygonMiden / miden-base

Core components of the Polygon Miden rollup
MIT License
70 stars 44 forks source link

FPI: foreign account data loader #896

Closed Fumuran closed 1 month ago

Fumuran commented 1 month ago

WiP

TODO:

Fumuran commented 1 month ago

For some reason api.rs file in the tx-prover keeps generating with strange formatting, on which rustfmt is complaining.

PhilippGackstatter commented 1 month ago

For some reason api.rs file in the tx-prover keeps generating with strange formatting, on which rustfmt is complaining.

prost-build does its own formatting with prettyplease by default and the format feature is enabled by default, too. So since that code is already formatted plus generated code tends not to be looked at very much it seems fine to just skip the formatting from rustfmt for the generated module. You could just add this in bin/tx-prover/src/server/mod.rs:

#[rustfmt::skip]
pub mod generated;
Fumuran commented 1 month ago

So since that code is already formatted plus generated code tends not to be looked at very much it seems fine to just skip the formatting from rustfmt for the generated module. You could just add this in bin/tx-prover/src/server/mod.rs:

I was thinking about it, It was just strange to me that current version of this module in next branch has a different formatting, which is accepted by the CI formatting checker. Somehow Santiago managed to make the proper formatting, so I should be able to do so too.

Fumuran commented 1 month ago

Well, it turned out that implementation of the foreign account verification took only a few more lines, so I included it in this PR.

PhilippGackstatter commented 1 month ago

I was thinking about it, It was just strange to me that current version of this module in next branch has a different formatting, which is accepted by the CI formatting checker. Somehow Santiago managed to make the proper formatting, so I should be able to do so too.

If you force a rebuild of that file on next it also does not conform to what rustfmt expects. So I think the proper formatting on next is just the result of make format. Actually, the tx_kernel_errors.rs has the same issue now and it keeps regenerating on next and shows up as a changed file in git status, which is a bit annoying. I think we should probably add a rustfmt::skip to both of these modules. Wdyt :slightly_smiling_face: ?

bobbinth commented 1 month ago

I think we should probably add a rustfmt::skip to both of these modules.

Yeah - for auto-generated files I think we should skip the formatting so that they don't change as rustfmt rules get updated.