# Supporting \`SET\_VERSIONSTAMPED\_VALUE\` v1 format in newer language bindings

**URL:** <https://forums.foundationdb.org/t/supporting-set-versionstamped-value-v1-format-in-newer-language-bindings/3049>\
**Category:** Development\
**Tags:** bindings\
**Created:** [December 1, 2021, 4:59am UTC](https://forums.foundationdb.org/t/supporting-set-versionstamped-value-v1-format-in-newer-language-bindings/3049 "2021-12-01T04:59:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajivr](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/rajivr/32/1100_2.png) [@rajivr](https://forums.foundationdb.org/u/rajivr)\
**Post date:** [December 1, 2021, 4:59am UTC](https://forums.foundationdb.org/t/supporting-set-versionstamped-value-v1-format-in-newer-language-bindings/3049/1 "2021-12-01T04:59:31Z")

</div>

I was wondering if we really need to support `SET_VERSIONSTAMPED_VALUE` v1 format in our language bindings?

For the rust binding that I am currently working on, I plan on supporting API version 630 and beyond _only_ (Btw, I am really looking forward to FDB 7.0 release. 🙂 )

It looks like `api.py` automatically injects tests for v1 format [here](https://github.com/apple/foundationdb/blob/6.3.22/bindings/bindingtester/tests/api.py#L481-L484). (I spent a week tracking this down, as I assumed the test failure was a bug in my binding layer. In the process I experienced first hand what makes FDB testing special. 🙂 )

---

<div class="post-metadata">

**Author:** ![ajbeamon](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/ajbeamon/32/13_2.png) [@ajbeamon](https://forums.foundationdb.org/u/ajbeamon)\
**Post date:** [December 1, 2021, 6:22am UTC](https://forums.foundationdb.org/t/supporting-set-versionstamped-value-v1-format-in-newer-language-bindings/3049/2 "2021-12-01T06:22:43Z")

</div>

How are you specifying the command for your tester? If you define it in `known_testers.py`, then I think you can also specify a minimum API version it can use for a test. If it uses only newer API versions, then it shouldn’t generate versionstamp operations using the old format.

I don’t think it’s possible to specify a minimum API version if you pass in the command for the tester directly in the binding tester arguments, though that’s probably something that could be easily changed. It is possible to choose an exact API version to use this way, if you wanted.

---

<div class="post-metadata">

**Author:** ![rajivr](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/rajivr/32/1100_2.png) [@rajivr](https://forums.foundationdb.org/u/rajivr)\
**Post date:** [December 1, 2021, 6:54am UTC](https://forums.foundationdb.org/t/supporting-set-versionstamped-value-v1-format-in-newer-language-bindings/3049/3 "2021-12-01T06:54:04Z")

</div>

> [@ajbeamon](#):
>
> How are you specifying the command for your tester?

I am using the following command.

```auto
bindingtester.py rust --test-name api --compare --num-ops 1000 --logging-level WARNING 2>&1

```

> [@ajbeamon](#):
>
> If you define it in `known_testers.py` , then I think you can also specify a minimum API version it can use for a test. If it uses only newer API versions, then it shouldn’t generate versionstamp operations using the old format.

I am using `known_testers.py`. As you can see from [here](https://github.com/rajivr/fdb/blob/22553fd77327bd147aa4594451d890ecb8ea55a9/fdb-stacktester/bindingtester-630/bindingtester/known_testers.py#L60-L61), I’ve increased the minimum API version to `630` for python tester.

However, it is still generating versionstamp tests for older format. I think that is because the `if` condition [here](https://github.com/apple/foundationdb/blob/6.3.22/bindings/bindingtester/tests/api.py#L475-L484) in `api.py` generates v2 tests if API version `>= 520`, but defaults to generating `v1` tests in any case.

Once I removed the default generation of v1 tests in the imported version of `api.py` [here](https://github.com/rajivr/fdb/blob/22553fd77327bd147aa4594451d890ecb8ea55a9/fdb-stacktester/bindingtester-630/bindingtester/tests/api.py#L377-L383), tests started to pass.

---

<div class="post-metadata">

**Author:** ![ajbeamon](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/ajbeamon/32/13_2.png) [@ajbeamon](https://forums.foundationdb.org/u/ajbeamon)\
**Post date:** [December 1, 2021, 3:33pm UTC](https://forums.foundationdb.org/t/supporting-set-versionstamped-value-v1-format-in-newer-language-bindings/3049/4 "2021-12-01T15:33:38Z")

</div>

That looks right for the definition for the rust tester, and it shouldn’t be necessary to modify the minimum API version of any other tester.

The test that you linked is still intended to be generating the correct format based on the API version. If you look at the [definition of `versionstamp_value`](https://github.com/apple/foundationdb/blob/903f8dfe10139eda94eea31343d83c0385e032e0/bindings/bindingtester/tests/ __init__.py#L90), it is written to be conditional on the API version to choose which one to use.

That said, it is possible that the thing that is failing is somewhere here rather than in your test. You might have to instrument either this or your test a bit to see what’s going on.
