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

fix: missing KeyError and incorrect existence checking when changing default node #150

Closed
wants to merge 3 commits into from

Conversation

antazoey
Copy link
Contributor

@antazoey antazoey commented Jan 30, 2024

What was wrong?

Related to Issue #
fixes #129

How was it fixed?

Todo:

  • Clean up commit history

  • Add or update documentation related to these changes

  • Add entry to the release notes

Cute Animal Picture

                                                                ████████████                    
                    ████████      ▓▓██████                ██████▒▒▓▓▓▓▒▒▒▒▒▒████                
                  ██░░░░░░░░██  ██░░░░░░░░██          ████░░▓▓▒▒░░░░░░░░▒▒▓▓▓▓▓▓████            
                ██░░░░▒▒░░░░░░██░░░░░░▒▒▒▒░░██      ██▒▒░░▓▓░░░░▒▒▒▒▓▓▓▓▓▓▒▒░░░░░░▒▒██          
                ██▒▒▒▒░░██████▒▒░░░░████▒▒▒▒▒▒██  ██▒▒░░▓▓░░░░▒▒▓▓▓▓░░░░░░░░▒▒░░▒▒░░░░▓▓        
                ██░░████░░░░██▒▒▒▒██░░░░██░░░░████░░░░▓▓░░▒▒░░▓▓░░░░░░░░░░░░░░░░▒▒░░░░▒▒██      
                ████▒▒▒▒▒▒░░██░░░░██░░░░██░░▒▒██████████░░░░▓▓░░░░░░░░░░▒▒▒▒▒▒░░░░░░░░▒▒░░██    
                ██▒▒░░░░░░░░██░░▒▒██░░░░██░░░░██▒▒░░░░░░██▓▓░░░░░░░░░░░░▒▒▒▒▒▒░░░░░░░░░░░░██    
                ██░░▒▒▒▒▒▒▒▒██▒▒░░████████░░░░████████████▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒██  
              ██▒▒▓▓▒▒░░░░░░████▒▒░░▒▒░░░░░░██░░██▓▓░░▒▒▓▓░░░░▒▒▒▒▒▒░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒░░██  
              ██▒▒▒▒▒▒██████▒▒▒▒░░▒▒▒▒▒▒▒▒░░▒▒░░██▓▓▒▒▓▓▒▒░░░░▒▒▒▒▒▒▒▒▒▒▒▒░░░░▒▒▒▒▒▒▒▒▒▒▒▒░░██  
              ████████▒▒░░▒▒▒▒▒▒▒▒░░░░▒▒▒▒▒▒░░░░▒▒██░░▓▓▒▒░░▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒░░██
              ██▒▒▓▓░░░░░░████████░░░░▒▒▒▒░░░░▒▒▒▒██░░▓▓▒▒░░▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░▒▒▒▒▒▒░░▒▒▒▒██
            ▓▓▒▒▓▓▒▒░░░░▓▓  ▓▓░░██░░▒▒▒▒░░░░▒▒▒▒░░▒▒██▒▒░░░░▒▒▒▒░░░░░░░░░░▒▒▒▒▒▒▒▒░░▒▒▒▒▒▒░░▒▒██
            ██░░▓▓░░░░░░██▓▓▓▓░░██░░░░░░░░▒▒▒▒▒▒▒▒▒▒██▒▒▒▒░░▒▒▒▒░░░░░░░░▒▒▒▒▒▒▒▒▒▒░░▒▒▒▒░░░░▒▒██
          ██▒▒▓▓▒▒░░▒▒░░██▓▓▓▓██▒▒░░░░░░░░▒▒▒▒▒▒░░░░░░██░░▒▒▒▒▒▒░░▒▒░░██  ▒▒░░▒▒▒▒▒▒▒▒░░░░░░░░██
          ██▒▒▓▓▒▒░░▒▒░░██████▒▒░░░░░░░░░░░░░░▒▒░░░░░░██▒▒░░░░░░░░▒▒▒▒░░██░░▒▒░░░░▒▒▒▒▒▒░░░░██  
        ▓▓██████▒▒░░▒▒░░▒▒▒▒▒▒░░░░░░  ░░░░░░██░░▒▒▒▒░░▒▒██░░░░░░▒▒▒▒▒▒░░██░░░░░░░░░░▒▒░░░░  ██  
        ██░░░░██░░░░▒▒▒▒░░▒▒░░  ░░░░░░░░  ██░░▒▒░░░░████████░░▒▒░░░░▒▒░░  ██  ░░░░░░░░░░░░██    
        ████▓▓▒▒▒▒░░▒▒▒▒▒▒▒▒░░░░░░░░░░░░▓▓░░░░░░▓▓▓▓▒▒░░▓▓▒▒████░░░░▒▒░░  ██▓▓▓▓  ░░░░░░▓▓░░    
          ██▓▓░░░░▒▒░░░░▒▒░░░░░░░░░░░░██░░░░▒▒██▒▒▒▒░░▒▒▒▒░░▒▒▒▒██▒▒░░▒▒░░██    ▓▓██████        
            ██▓▓▒▒▒▒▒▒▒▒░░░░░░  ░░████░░░░░░░░▒▒░░░░▒▒██████░░▒▒▒▒██░░▒▒░░░░██                  
              ████    ░░  ░░██████    ░░░░░░░░░░░░████▒▒▒▒████░░░░▒▒██░░░░░░██                  
                  ██▒▒████▓▓▒▒██░░░░░░░░░░░░░░░░▓▓▒▒▒▒░░▒▒██▒▒██▒▒░░██▒▒░░░░██                  
                    ████▒▒▒▒░░██░░░░░░░░░░░░░░  ▒▒░░▒▒▒▒▒▒██▒▒░░██████░░░░░░██                  
      ██████████████░░░░▒▒░░░░██░░░░░░░░░░░░░░░░░░▒▒░░▒▒▒▒██░░▒▒░░░░░░░░░░░░██                  
      ██▒▒▒▒▒▒░░▒▒░░▒▒▒▒░░░░████░░░░░░░░░░░░░░░░░░▒▒░░░░▒▒▒▒██░░▒▒▒▒░░▒▒░░░░██                  
      ██░░░░░░░░▒▒▒▒▒▒██████  ██░░░░░░░░░░░░░░░░░░▒▒░░░░▒▒░░██░░░░░░░░▒▒░░░░██                  
        ██▓▓██████████        ██░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒░░██▒▒░░▒▒░░▒▒░░░░██                  
        ░░  ░░░░░░░░    ▓▓▓▓████░░  ░░░░░░░░░░░░░░░░▒▒▓▓██▓▓████░░░░░░░░░░░░██                  
                      ██░░▒▒▒▒▒▒░░    ░░░░░░░░░░░░░░░░▒▒▒▒▒▒░░▒▒██▒▒▒▒░░░░██                    
                    ██░░░░▒▒░░▒▒    ░░░░░░░░░░░░  ▒▒░░▒▒▒▒░░░░▒▒░░██░░░░░░██                    
                    ██▒▒░░▒▒░░▒▒░░░░░░░░░░░░░░░░░░░░▒▒░░░░░░░░░░▒▒██░░  ▓▓░░                    
                  ▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒░░░░░░▒▒▒▒░░▒▒▓▓░░██                      
                  ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒░░░░▒▒▒▒▒▒░░░░██████                      
                  ██░░░░░░░░▒▒░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒░░░░██                          
              ██▓▓██░░░░░░░░░░▒▒░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒░░▒▒░░██████                        
            ██▒▒▒▒▒▒░░░░░░░░░░░░░░░░  ░░░░░░░░░░░░░░▒▒▒▒░░░░░░░░▒▒▒▒▒▒▒▒██                      
██████      ██░░░░▒▒▒▒▒▒░░░░▒▒▒▒▒▒▒▒▒▒  ░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒░░▒▒░░▒▒░░██    ██████            
██▒▒▒▒████████▓▓██▒▒██████▓▓██████████▓▓▓▓▒▒▒▒▒▒▓▓▒▒▓▓████████▒▒████▒▒▓▓██▓▓▓▓▒▒▒▒██            
  ████░░░░▓▓░░░░░░░░▒▒░░░░░░░░░░░░░░░░░░░░░░░░▒▒░░▓▓▓▓░░▓▓▓▓▓▓░░░░░░▓▓▓▓░░▓▓░░████              
      ████████████████████████████████████████████████████████████████████████                  
                  ████                                        ████                              
                ██░░░░██                                    ▓▓░░░░██                            
                ██░░░░██                                    ██░░░░██                            
                  ████                                        ████                              

@antazoey antazoey force-pushed the fix/smt-default-checks branch 2 times, most recently from a084c5e to 658039f Compare January 30, 2024 20:00
@antazoey antazoey force-pushed the fix/smt-default-checks branch from 658039f to fc179a8 Compare January 30, 2024 20:01
@antazoey antazoey force-pushed the fix/smt-default-checks branch from 3de0fda to 11b8165 Compare January 30, 2024 21:12
@antazoey antazoey force-pushed the fix/smt-default-checks branch from 11b8165 to 9a79146 Compare January 30, 2024 21:13
@@ -252,7 +252,7 @@ def get(self, key: bytes) -> bytes:
value, _ = self._get(key)

# Ensure that it isn't blank!
if value == BLANK_NODE:
if value == self._default:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Realizing this is not probably, wanted.

If this default is anything other than a blank
node, then all keys "exist" in the database, which mimics the behavior of
Ethereum on-chain datastores.

(from the docs)

will change

@antazoey antazoey closed this Jan 31, 2024
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.

smt.exists(item) doesn't work if default node value is set
1 participant