You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function fft_fr() in c-kzg is hardcoded to use expanded_roots_of_unity (subgroup of size 8192) even tho it takes a configurable size n parameter.
The function is used with at least n=8192 (good case), n=2048 and n=128 throughout the protocol.
Due to hardcoding a specific subgroup, when it's called with the wrong n the FFT does not do what it's supposed to do (evaluate/interpolate the polynomial), but it does work in the sense of: recovered_poly_coeff == ifft(fft(poly_coeff)) and hence the protocol carries through.
We should make sure that the code does what it's supposed to do here for all cases of n.
Also, we should simplify the FFT implementation when possible. For example, is there a reason for the stride arguments?
The text was updated successfully, but these errors were encountered:
asn-d6
changed the title
Simplify and improve the FFT functions
Simplify and improve the FFT functions (das branch)
Jun 27, 2024
This is related to #439 and something I encountered while coding ethereum/consensus-specs#3781 in c-kzg.
The function
fft_fr()
in c-kzg is hardcoded to use expanded_roots_of_unity (subgroup of size 8192) even tho it takes a configurable size n parameter.The function is used with at least
n=8192
(good case),n=2048
andn=128
throughout the protocol.Due to hardcoding a specific subgroup, when it's called with the wrong
n
the FFT does not do what it's supposed to do (evaluate/interpolate the polynomial), but it does work in the sense of:recovered_poly_coeff == ifft(fft(poly_coeff))
and hence the protocol carries through.We should make sure that the code does what it's supposed to do here for all cases of
n
.Also, we should simplify the FFT implementation when possible. For example, is there a reason for the
stride
arguments?The text was updated successfully, but these errors were encountered: