zkevm-circuits icon indicating copy to clipboard operation
zkevm-circuits copied to clipboard

Standardize type U256 and Word

Open hero78119 opened this issue 1 year ago • 2 comments

Describe the feature you would like

After introduce word lo/hi optimisation, now there are 2 ambiguous Word type.

  • eth_types::Word
  • utils::word::Word<F>

Proposed by @adria0, since eth_types::Word just a type alias of U256, we might consider remove it and turn to use U256 instead. See discussion thread https://github.com/privacy-scaling-explorations/zkevm-circuits/pull/1414#issuecomment-1557430722

Additional context

No response

hero78119 avatar Jun 05 '23 07:06 hero78119

We also have the trait ToWord with the method to_word. If we remove Word we can rename the trait and method to ToU256, to_u256.

ed255 avatar Jun 06 '23 11:06 ed255

I want to add that using U256 also solves a problem in the Keccak circuit. We use the term "word" for the u64 word in the Keccak circuit, which confuses with the EVM U256 word.

ChihChengLiang avatar Jun 06 '23 14:06 ChihChengLiang