fix: parar varredura sequencial ao atingir o fim do range (-r ...:TO)#427
Open
k-vanio wants to merge 2 commits into
Open
fix: parar varredura sequencial ao atingir o fim do range (-r ...:TO)#427k-vanio wants to merge 2 commits into
k-vanio wants to merge 2 commits into
Conversation
No modo sequencial (address/rmd160/vanity) o keyhunt processava um lote inteiro de N_SEQUENTIAL_MAX (4 bi) por iteração, ignorando o limite TO do -r. Quando o alvo não estava no range, a thread varria muito além do bloco e nunca encerrava (não chegava em ends[]=1), travando workers que dependem da saída do processo para concluir o bloco. Agora o loop interno também para quando key_mpz >= n_range_end. O modo random (FLAGRANDOM) segue sem limite, como antes.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR updates the sequential worker loops to stop scanning once the configured end-of-range is reached (while keeping random mode behavior unchanged), addressing cases where workers would continue far beyond the intended block.
Changes:
- Add an end-of-range guard to the sequential
do...whileloops inthread_process. - Apply the same end-of-range guard to the vanity worker loop in
thread_process_vanity. - Document the rationale inline (including why random mode remains unbounded).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| keyhunt original varre um lote inteiro de N_SEQUENTIAL_MAX (4 bi) ignorando o | ||
| TO; isso fazia o worker varrer muito além do bloco e nunca encerrar. Random | ||
| (FLAGRANDOM) segue sem limite, como antes. */ | ||
| }while(count < N_SEQUENTIAL_MAX && continue_flag && (FLAGRANDOM || key_mpz.IsLower(&n_range_end))); |
| keyhunt original varre um lote inteiro de N_SEQUENTIAL_MAX (4 bi) ignorando o | ||
| TO; isso fazia o worker varrer muito além do bloco e nunca encerrar. Random | ||
| (FLAGRANDOM) segue sem limite, como antes. */ | ||
| }while(count < N_SEQUENTIAL_MAX && continue_flag && (FLAGRANDOM || key_mpz.IsLower(&n_range_end))); |
Comment on lines
+3094
to
+3097
| /* fork puzzle: no modo sequencial, para ao atingir o fim do range (-r ...:TO). | ||
| keyhunt original varre um lote inteiro de N_SEQUENTIAL_MAX (4 bi) ignorando o | ||
| TO; isso fazia o worker varrer muito além do bloco e nunca encerrar. Random | ||
| (FLAGRANDOM) segue sem limite, como antes. */ |
…tel) -march=native fixava o binario no ISA da maquina de build, gerando SIGILL (Illegal instruction) ao rodar em CPUs diferentes (ex.: imagem buildada em AMD travava em Intel). x86-64-v3 (AVX2+BMI2+FMA) e portavel entre AMD/Intel modernos e casa com o GOAMD64=v3 do binario Go.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No modo sequencial (address/rmd160/vanity) o keyhunt processava um lote inteiro de N_SEQUENTIAL_MAX (4 bi) por iteração, ignorando o limite TO do -r. Quando o alvo não estava no range, a thread varria muito além do bloco e nunca encerrava (não chegava em ends[]=1), travando workers que dependem da saída do processo para concluir o bloco.
Agora o loop interno também para quando key_mpz >= n_range_end. O modo random (FLAGRANDOM) segue sem limite, como antes.