create2crunch icon indicating copy to clipboard operation
create2crunch copied to clipboard

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

Open fmhall opened this issue 3 years ago • 2 comments

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.

fmhall avatar Oct 22 '22 22:10 fmhall

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

  • the 4 is the threshold to save on the file the leading bytes (4 bytes which means its 8 leading digits)
  • the 6 is the threshold to save on the file the total 0-bytes (pair of 0s on specific place)

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

Hope this helps you

acegilz avatar Oct 23 '22 22:10 acegilz

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?

fmhall avatar Oct 24 '22 23:10 fmhall