Skip to content

Slices without reflect#12

Open
potuz wants to merge 2 commits into
mainfrom
slice_without_reflect
Open

Slices without reflect#12
potuz wants to merge 2 commits into
mainfrom
slice_without_reflect

Conversation

@potuz

@potuz potuz commented May 10, 2023

Copy link
Copy Markdown
Collaborator

This PR changes the assembly code to receive pointers to the first bytes of the slices instead of the slices themselves. This allows the Go binding to simply pass pointers to the first byte and be able to expose functions that take either [][32]byte or []byte.

The generic fallback does copy chunks and digests in the case of byte slice arguments.

This PR changes the assembly code to receive pointers to the first bytes
of the slices instead of the slices themselves. This allows the Go
binding to simply pass pointers to the first byte and be able to expose
functions that take either `[][32]byte` or `[]byte`.

The generic fallback does copy chunks and digests in the case of byte
slice arguments.
@elee1766

elee1766 commented May 16, 2023

Copy link
Copy Markdown

https://github.com/ledgerwatch/erigon/actions/runs/4987214900/jobs/8928757394 - the hashes aren't matching up here with this pr.
one failing test is here, https://github.com/ledgerwatch/erigon/blob/devel/cl/phase1/core/state/ssz_test.go#L21-L33

the data is in the tests directory (go embedded)

i can try to test take_slices branch later if needed, it is sorta annoying to do because it gets rid of the original function (which we are using elsewhere in code)

@potuz

potuz commented May 16, 2023

Copy link
Copy Markdown
Collaborator Author

https://github.com/ledgerwatch/erigon/actions/runs/4987214900/jobs/8928757394 - the hashes aren't matching up here with this pr. one failing test is here, https://github.com/ledgerwatch/erigon/blob/devel/cl/phase1/core/state/ssz_test.go#L21-L33

the data is in the tests directory (go embedded)

i can try to test take_slices branch later if needed, it is sorta annoying to do because it gets rid of the original function (which we are using elsewhere in code)

Does that test pass with gohashtree in any way? this PR passes unit tests here hashing, it's hard for me to check against Erigon's test setup, if you can give me a minimum reproducible test that would help.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants