0age / create2crunch

A Rust program for finding salts that create gas-efficient Ethereum addresses via CREATE2.
MIT License
472 stars 83 forks source link

[Question] How does the GPU know the reward function? #3

Open fmhall opened 1 year ago

fmhall commented 1 year ago

I've been playing around with the repo and I'm a bit confused with the GPU code.

Here's my confusion:

if you set const ZERO_BYTE: u8 = 0xff; for the sake of demonstration, the CPU code will now search for addresses that start with 0xff....

However, the GPU code continues to search for addresses with leading zeros. Why is this?

Thanks in advance. I'm a noob when it comes to working with the GPU.

acegilz commented 1 year ago

While brute-forcing, it automatically looks for both leading AND cumulative 0bytes on those billion generated address

From the example, when you run: cargo run --release $FACTORY $CALLER $INIT_CODE_HASH 2 4 6

It will output & save on the file any generated address that matches any of both conditions

Hope this helps you

fmhall commented 1 year ago

For sure! But after replacing ZERO_BYTE with 0xff instead of 0x00, if you look at the gpu code, it should now do the same process but return addresses with f's instead of 0's, no?