Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Digest::Keccak::metadata is not initialized properly with Ruby 3.4.1 #27

Closed
lethaale opened this issue Dec 27, 2024 · 4 comments · Fixed by #29
Closed

Digest::Keccak::metadata is not initialized properly with Ruby 3.4.1 #27

lethaale opened this issue Dec 27, 2024 · 4 comments · Fixed by #29
Labels
bug Something isn't working

Comments

@lethaale
Copy link

Hello!

Thanks a lot for this gem, it's so useful!

I recently updated to Ruby 3.4.1 and when running a simple rails c I get this error

=> rails c
{path}.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/eth-0.5.13/lib/eth/util.rb:43:in 'Class#new': Digest::Keccak::metadata is not initialized properly (TypeError)

      Digest::Keccak.new(256).digest str
                         ^^^
        from {path}.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/eth-0.5.13/lib/eth/util.rb:43:in 'Eth::Util#keccak256'
        from {path}.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/eth-0.5.13/lib/eth/address.rb:106:in 'Eth::Address#checksum'
        from {path}.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/eth-0.5.13/lib/eth/address.rb:68:in 'Eth::Address#checksummed'
        from {path}.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/eth-0.5.13/lib/eth/address.rb:81:in 'Eth::Address#checksum_matches?'
        from {path}.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/eth-0.5.13/lib/eth/address.rb:51:in 'Eth::Address#valid?'
        from {path}.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/eth-0.5.13/lib/eth/address.rb:37:in 'Eth::Address#initialize'
        from {path}.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/eth-0.5.13/lib/eth/ens.rb:26:in 'Class#new'
        from {path}.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/eth-0.5.13/lib/eth/ens.rb:26:in '<module:Ens>'
        from {path}.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/eth-0.5.13/lib/eth/ens.rb:22:in '<module:Eth>'
        from {path}.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/eth-0.5.13/lib/eth/ens.rb:19:in '<main>'
        from {path}.rbenv/versions/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
[...]
        from ./bin/rails:4:in '<main>'

Any idea what might cause / fix it?

@q9f q9f added the bug Something isn't working label Dec 29, 2024
@q9f q9f transferred this issue from q9f/eth.rb Dec 29, 2024
@q9f
Copy link
Owner

q9f commented Dec 29, 2024

Moving to https://github.com/q9f/keccak.rb

I'll take a look

@q9f
Copy link
Owner

q9f commented Dec 29, 2024

I'm still on 3.3 but I can confirm this through the CI in #28

I'll dig into the changelog of Ruby

byroot added a commit to byroot/keccak.rb that referenced this issue Dec 29, 2024
@q9f q9f closed this as completed in #29 Dec 29, 2024
@q9f q9f closed this as completed in 9278714 Dec 29, 2024
@q9f
Copy link
Owner

q9f commented Dec 29, 2024

@lethaale it should be fixed by pulling in the updated keccak lib v1.3.2 automatically. just refresh your gem installs (gem install / bundle). please let me know if there is anything else!

thanks @byroot for the quick fix!

@lethaale
Copy link
Author

lethaale commented Jan 2, 2025

@lethaale it should be fixed by pulling in the updated keccak lib v1.3.2 automatically. just refresh your gem installs (gem install / bundle). please let me know if there is anything else!

thanks @byroot for the quick fix!

So quick, thanks a lot to both of you! Confirmed working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants