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

NNS update for 0.20.0 #419

Merged
merged 19 commits into from
Jul 30, 2024
Merged

NNS update for 0.20.0 #419

merged 19 commits into from
Jul 30, 2024

Commits on Jul 29, 2024

  1. Configuration menu
    Copy the full SHA
    dad079b View commit details
    Browse the repository at this point in the history
  2. nns: Remove unused config file

    Signed-off-by: Anna Shaleva <[email protected]>
    AnnaShaleva authored and roman-khimov committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    c732296 View commit details
    Browse the repository at this point in the history
  3. nns: Fix typo in the method description

    Signed-off-by: Anna Shaleva <[email protected]>
    AnnaShaleva authored and roman-khimov committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    d77cfe5 View commit details
    Browse the repository at this point in the history
  4. nns: Restrict the maximum number of records with the same type

    Signed-off-by: Anna Shaleva <[email protected]>
    AnnaShaleva authored and roman-khimov committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    51873d5 View commit details
    Browse the repository at this point in the history
  5. nns: Move common code to a separate method

    Reuse getAllRecords for GetAllRecords.
    
    Signed-off-by: Anna Shaleva <[email protected]>
    AnnaShaleva authored and roman-khimov committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    c0b73a6 View commit details
    Browse the repository at this point in the history
  6. nns: Fix CNAME resolution rules

    Do not include CNAME to the resulting list if we're looking for another
    record type. If it's CNAME than it must be resolved.
    
    Signed-off-by: Anna Shaleva <[email protected]>
    AnnaShaleva authored and roman-khimov committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    9db9ace View commit details
    Browse the repository at this point in the history
  7. nns: Refactor record-related operations code

    Do not move parts of SetRecord/AddRecord to a separate functions,
    it makes the contract code more complicated. Also, improve
    documentation a bit.
    
    Signed-off-by: Anna Shaleva <[email protected]>
    AnnaShaleva authored and roman-khimov committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    9f4a35e View commit details
    Browse the repository at this point in the history
  8. nns: use tokenID for setRecord operations

    a.b.c.d can be an "a.b" record of "c.d" and can be "a" record of "b.c.d", the
    first one would fail to setRecord currently:
    
      at instruction 4287 (THROW): unhandled exception: "parent domain has expired"
    
    which is a 5758c84 regression.
    
    Signed-off-by: Roman Khimov <[email protected]>
    roman-khimov committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    d677c66 View commit details
    Browse the repository at this point in the history
  9. nns: Move common record checking code to a separate function

    Don't repeat it each time.
    
    Signed-off-by: Anna Shaleva <[email protected]>
    AnnaShaleva authored and roman-khimov committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    7255441 View commit details
    Browse the repository at this point in the history
  10. nns: Accept token ID as an argument for storeRecord

    It doesn't save VM opcodes, but allows to keep record key creation
    logic in a single place which prevents the code from bugs appearance.
    
    Signed-off-by: Anna Shaleva <[email protected]>
    AnnaShaleva authored and roman-khimov committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    224936c View commit details
    Browse the repository at this point in the history
  11. nns: Reuse storeRecord for storing SOA record

    Less code repeating.
    
    Signed-off-by: Anna Shaleva <[email protected]>
    AnnaShaleva authored and roman-khimov committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    78862e4 View commit details
    Browse the repository at this point in the history
  12. nns: Move token key creation to a separate function

    Signed-off-by: Anna Shaleva <[email protected]>
    AnnaShaleva authored and roman-khimov committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    c8825a1 View commit details
    Browse the repository at this point in the history
  13. nns: reuse existing context in tokenIDFromName

    Signed-off-by: Anna Shaleva <[email protected]>
    AnnaShaleva authored and roman-khimov committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    836a5de View commit details
    Browse the repository at this point in the history
  14. nns: Keep isAvailable in sync with register

    If conflicting records '*.domain' are present on new domain
    registration, then `isAvailable` should return false for this
    domain. Ref.
    f25296b.
    
    Signed-off-by: Anna Shaleva <[email protected]>
    AnnaShaleva authored and roman-khimov committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    1bb8b1c View commit details
    Browse the repository at this point in the history
  15. nns: Use millisecondsInSeconds constant where appropriate

    Signed-off-by: Anna Shaleva <[email protected]>
    AnnaShaleva authored and roman-khimov committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    8f751bc View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2024

  1. nns: limit max number of records to 16

    These numbers are pretty much arbitrary, but we currently don't need more than
    that.
    
    Signed-off-by: Roman Khimov <[email protected]>
    roman-khimov committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    22be33c View commit details
    Browse the repository at this point in the history
  2. nns: separate "too long name" from other errors

    Part of #411.
    
    Signed-off-by: Roman Khimov <[email protected]>
    roman-khimov committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    650a7dc View commit details
    Browse the repository at this point in the history
  3. nns: simplify checks on split, use different errors

    1. splitAndCheck doesn't need allowMultipleFragments since there is exactly
       one user of it and it checks for the number of fragments anyway.
    2. We can panic right inside of it with a bit more details, nil fragments are
       never valid.
    3. Except for one case in checkRecord where the error must be different, so
       safeSplitAndCheck is introduced.
    
    Fixes #411.
    
    Signed-off-by: Roman Khimov <[email protected]>
    roman-khimov committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    6dfd53b View commit details
    Browse the repository at this point in the history
  4. tests: fix sporadic container test failure

    Sometimes 10 is exactly the value, so changing it doesn't make the ID different:
    
                  	Error Trace:	/home/runner/go/pkg/mod/github.com/nspcc-dev/[email protected]/pkg/neotest/basic.go:218
            	            				/home/runner/go/pkg/mod/github.com/nspcc-dev/[email protected]/pkg/neotest/client.go:108
            	            				/home/runner/work/neofs-contract/neofs-contract/tests/container_test.go:237
            	Error:      	Not equal:
            	            	expected: 0x1
            	            	actual  : 0x2
            	Test:       	TestContainerPut/standard_deploy/with_nice_names/register_in_advance
            	Messages:   	at instruction 2149 (THROW): unhandled exception: "container was previously deleted"
    
    Signed-off-by: Roman Khimov <[email protected]>
    roman-khimov committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    e5d3659 View commit details
    Browse the repository at this point in the history