kkrt-labs / kakarot-ssj

Kakarot zkEVM - rewrite in the latest version of Cairo
https://www.kakarot.org
MIT License
114 stars 53 forks source link

dev: update edition to 2023_11 #760

Open enitrat opened 2 months ago

enitrat commented 2 months ago

and leverage visibility attributes properly

TAdev0 commented 2 months ago

@enitrat there is a an issue with the corelib that makes it impossible for now to update to 2023_11 : the nullable_from_box function currently has a pub(crate) visibility, hence its not possible to use it in any other crate.

https://github.com/starkware-libs/cairo/blob/ad6aeb70ac0ab6c6c129eb088df682705d4f1853/corelib/src/nullable.cairo#L14

Everything else in nullable.cairo is pub , and nullable_from_box is not used eniwhere in the corelib so the pub(crate) attribute doesn't make sense.

Currently, for example in vec.cairo file in alexandria data structre:

    fn push(ref self: NullableVec<T>, value: T) -> () {
        self.items.insert(self.len.into(), core::nullable::nullable_from_box(BoxTrait::new(value)));
        self.len = core::integer::u32_wrapping_add(self.len, 1_usize);
    }
    Item `core::nullable_from_box` is not visible in this context.
enitrat commented 2 months ago

is not used eniwhere

lol

TAdev0 commented 2 months ago

@enitrat i'm working on it , i can be assigned to it

enitrat commented 2 months ago

I think you're going to have a hard time for now, it's best to do it later. Especially if we change test runner, we will need to write unit tests in the same modules, make a lot of modifications to the structure, etc