Skip to content

Undefined reference to NeoScrypt when using -DASM #7

Description

@globaltoken

Hello @ghostlander,

While compiling I receive an error: "unresolved refference to neoscrypt", which is just caused when using neoscrypt with -DSHA256 -DOPT -DASM -DMINER_4WAY.
If I delete -DASM -DMINER_4WAY, it works.

Why is neoscrypt not defined for -DASM -DMINER_4WAY?
And what to use at neoscrypt_4way *scratchpad arg?
What is scratchpad? any doc available?

Regards,
Pawel

Activity

  1. ghostlander commented on May 4, 2018

    @ghostlander
    Owner

    If you define -DASM, you have to assemble neoscrypt_asm.S and link towards neoscrypt_asm.o

    Scratchpad is a fixed size buffer in memory. Caller allocates and manages it. neoscrypt_4way() doesn't do memory allocation on its own unlike neoscrypt()

  2. changed the title [-]Undefined reference to neoscrpyt when using -DASM[/-] [+]Undefined reference to NeoScrypt when using -DASM[/+] on May 4, 2018
  3. globaltoken commented on May 4, 2018

    @globaltoken
    Author

    @ghostlander Thanks for answering.
    I linked the asm code, and it did not worked.

    Another strange thing: For hashing blocks with nVersion it is not working. Neither scrypt or yescrypt.
    While mining blocks with neoscrypt it goes through the whole loop and after 0xffff loop tries it repeats everything with nonce 0. So you have 65536 times the same hash, and after reset you have another different hash. I dont know what I missed here. It just finds block with nonce 0.

  4. ghostlander commented on May 4, 2018

    @ghostlander
    Owner

    Well, at least the PXC, ORB and HAL wallets use -DASM, so it's working.

    It's up to a miner or daemon to assemble properly a 80-byte block header hashed by NeoScrypt. Nonce can be any between 0 and 0xFFFFFFFF. There is also extra nonce in coin base.

  5. globaltoken commented on May 4, 2018

    @globaltoken
    Author

    @ghostlander Is just 80 byte possible? My blocks require min 81 byte or more because of Auxpow and nAlgo

  6. ghostlander commented on May 4, 2018

    @ghostlander
    Owner

    AuxPoW is for merged mining. The hashing is done on the parent chain. Aux chains verify PoW by reconstructing the block header as it could appear on the parent chain.

  7. globaltoken commented on May 4, 2018

    @globaltoken
    Author

    Thank you.
    I checked PXC and I saw that you Reverse the Bytes?
    Is this necessary for neoscrypt blocks?
    Because it seems that just neoscrypt blocks dont use any nonce while daemon generates blocks, and regtest takes very long to generate one block, other algos works fine (excluding yescrypt or scrypt).

    Sometimes I tried to generate Blocks in Regtest and it tooked about 30 minutes until I generated a yescrypt, scrypt or neoscrypt block.
    This just happens on daemon side mining as it seems.
    Any idea?

    Regards,
    Pawel

  8. ghostlander commented on May 5, 2018

    @ghostlander
    Owner

    Byte order of NeoScrypt is different to Scrypt or SHA-256. It's native little endian. It takes a while to generate a valid hash on CPU even at the lowest difficulty such as 1 / 2^12.

  9. globaltoken commented on May 5, 2018

    @globaltoken
    Author

    @ghostlander Thanks for your reply.
    If I just use the basic header, it works, with 80 bytes size.
    But if I use nAlgo with 81 bytes size it did not hash, every hash is the same.
    Do you know where to change this in the Blockchain?

    Thanks for your help.

    • Pawel
  10. ghostlander commented on May 7, 2018

    @ghostlander
    Owner

    It has to be 80 bytes exactly or padded up to. Mix nAlgo into an existing field such as nVersion.

  11. globaltoken commented on May 7, 2018

    @globaltoken
    Author

    Thanks @ghostlander for your help.
    I extracted the Basic 80 byte Header in a new Class for POW Validation and it worked, nAlgo and other things are in CBlock now, and GetPoWHash is in another class with just 80 bytes.

    Again thanks for your help.
    The other point: -DASM still not work, the neoscrypt_asm.o is compiled and linked.
    I use the newest neoscrypt Code that you have in this repo.
    I checked other neoscrypt Blockchains, they use another neoscrypt version where -DASM is not needed.

    Any suggestions here?

    Regards,
    Pawel

  12. ghostlander commented on May 11, 2018

    @ghostlander
    Owner

    That's an older version.

  13. globaltoken commented on May 14, 2018

    @globaltoken
    Author

    @ghostlander Okay where can I find newest Version?

  14. ghostlander commented on May 15, 2018

    @ghostlander
    Owner

    The newest is on GitHub as usual.

  15. globaltoken commented on May 16, 2018

    @globaltoken
    Author

    @ghostlander Oh I used Latest commit 9a52159 on 14 Mar 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions