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

Debugger. #28441

Merged
merged 1 commit into from
Dec 17, 2024
Merged

Debugger. #28441

merged 1 commit into from
Dec 17, 2024

Conversation

mikebenfield
Copy link
Collaborator

No description provided.

leo/cli/commands/interpret.rs Outdated Show resolved Hide resolved
interpreter/src/lib.rs Outdated Show resolved Hide resolved
interpreter/src/lib.rs Outdated Show resolved Hide resolved
interpreter/src/lib.rs Outdated Show resolved Hide resolved
integers::Integer as SvmIntegerParam,
};

type SvmAddress = SvmAddressParam<TestnetV0>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want these types parameterized over the Network?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

At the moment the interpreter only works with TestnetV0. It's not clear to me whether it's important that it works with the other Networks. What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We just rolled some updates where TestnetV0 and MainnetV0 can differ in behavior depending on the block height. I could see that as being a potential case, but not much else.

interpreter/src/cursor.rs Outdated Show resolved Hide resolved
interpreter/src/cursor.rs Outdated Show resolved Hide resolved
interpreter/src/cursor.rs Outdated Show resolved Hide resolved
@d0cd d0cd changed the title Interpreter. Debugger. Nov 20, 2024
@d0cd
Copy link
Collaborator

d0cd commented Nov 20, 2024

We should be also allow the debugger to start in a non-Leo context.

@d0cd
Copy link
Collaborator

d0cd commented Nov 20, 2024

It would be nice for the cursor for the REPL loop to show where we are currently at

> let foo: u8 = 1u8;

@mikebenfield mikebenfield force-pushed the interpreter branch 4 times, most recently from e8f93b2 to 28b9324 Compare December 6, 2024 23:26
@d0cd
Copy link
Collaborator

d0cd commented Dec 16, 2024

A tutorial on how to use the Leo debugger can be found here.

@d0cd d0cd marked this pull request as ready for review December 17, 2024 15:21
Copy link
Collaborator

@d0cd d0cd left a comment

Choose a reason for hiding this comment

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

Looks good overall! Left some minor nits.

@@ -31,6 +31,8 @@ use std::{fs, fs::ReadDir, path::PathBuf};

pub static LEO_FILE_EXTENSION: &str = ".leo";

pub static VALIDATOR_0_PRIVATE_KEY: &str = "APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
pub static VALIDATOR_0_PRIVATE_KEY: &str = "APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH";
pub static TEST_PRIVATE_KEY: &str = "APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH";

@@ -15,6 +15,7 @@
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.

use crate::{
VALIDATOR_0_PRIVATE_KEY,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
VALIDATOR_0_PRIVATE_KEY,
TEST_PRIVATE_KEY,

endpoint,
)?
.write_to(&path)?;
Env::<N>::new(Some(PrivateKey::<N>::from_str(VALIDATOR_0_PRIVATE_KEY)?), endpoint)?.write_to(&path)?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Env::<N>::new(Some(PrivateKey::<N>::from_str(VALIDATOR_0_PRIVATE_KEY)?), endpoint)?.write_to(&path)?;
Env::<N>::new(Some(PrivateKey::<N>::from_str(TEST_PRIVATE_KEY)?), endpoint)?.write_to(&path)?;

@d0cd d0cd merged commit aa6a5f3 into mainnet Dec 17, 2024
10 checks passed
@d0cd d0cd deleted the interpreter branch December 17, 2024 19:17
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.

2 participants